OSDN Git Service

Try to save a kernel call in ResolveRecoveryConflictWithVirtualXIDs.
authorRobert Haas <rhaas@postgresql.org>
Fri, 17 Dec 2010 16:32:02 +0000 (11:32 -0500)
committerRobert Haas <rhaas@postgresql.org>
Fri, 17 Dec 2010 16:32:02 +0000 (11:32 -0500)
If there's no work to be done, just exit quickly, before initialization.

src/backend/storage/ipc/standby.c

index 4f209ea..b659c32 100644 (file)
@@ -193,6 +193,10 @@ ResolveRecoveryConflictWithVirtualXIDs(VirtualTransactionId *waitlist,
        TimestampTz waitStart;
        char       *new_status;
 
+       /* Fast exit, to avoid a kernel call if there's no work to be done. */
+       if (!VirtualTransactionIdIsValid(*waitlist))
+               return;
+
        waitStart = GetCurrentTimestamp();
        new_status = NULL;              /* we haven't changed the ps display */