postgres.git / summary / log / commit / refs
commit 8bd4b89e240cc6488f5e1523202cc2d27e9970c0
Author: Robert Haas <rhaas@postgresql.org>
Date: Fri Dec 17 16:32:02 2010 +0000
First released in: 9.1.0
Try to save a kernel call in ResolveRecoveryConflictWithVirtualXIDs.
If there's no work to be done, just exit quickly, before initialization.
src/backend/storage/ipc/standby.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/backend/storage/ipc/standby.c b/src/backend/storage/ipc/standby.c
index 4f209eab688..b659c320585 100644
--- a/src/backend/storage/ipc/standby.c
+++ b/src/backend/storage/ipc/standby.c
@@ -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 */
[parent: 611fed371227]