aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2010-12-17 08:30:57 -0500
committerRobert Haas <rhaas@postgresql.org>2010-12-17 08:30:57 -0500
commit611fed371227f430e71d0ff7fed037f1006b410d (patch)
tree59826f9aa889b27b4554696cec45de515ca0cbb8
parentdf142bf82c84de5d0588ae7d52881501abb039ed (diff)
downloadpostgresql-611fed371227f430e71d0ff7fed037f1006b410d.tar.gz
postgresql-611fed371227f430e71d0ff7fed037f1006b410d.zip
Reset 'ps' display just once when resolving VXID conflicts.
This prevents the word "waiting" from briefly disappearing from the ps status line when ResolveRecoveryConflictWithVirtualXIDs begins a new iteration of the outer loop. Along the way, remove some useless pgstat_report_waiting() calls; the startup process doesn't appear in pg_stat_activity. Fujii Masao
-rw-r--r--src/backend/storage/ipc/standby.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/src/backend/storage/ipc/standby.c b/src/backend/storage/ipc/standby.c
index adf87a44c3d..4f209eab688 100644
--- a/src/backend/storage/ipc/standby.c
+++ b/src/backend/storage/ipc/standby.c
@@ -21,7 +21,6 @@
#include "access/xact.h"
#include "access/xlog.h"
#include "miscadmin.h"
-#include "pgstat.h"
#include "storage/bufmgr.h"
#include "storage/lmgr.h"
#include "storage/proc.h"
@@ -191,16 +190,14 @@ static void
ResolveRecoveryConflictWithVirtualXIDs(VirtualTransactionId *waitlist,
ProcSignalReason reason)
{
- while (VirtualTransactionIdIsValid(*waitlist))
- {
- TimestampTz waitStart;
- char *new_status;
-
- pgstat_report_waiting(true);
+ TimestampTz waitStart;
+ char *new_status;
- waitStart = GetCurrentTimestamp();
- new_status = NULL; /* we haven't changed the ps display */
+ waitStart = GetCurrentTimestamp();
+ new_status = NULL; /* we haven't changed the ps display */
+ while (VirtualTransactionIdIsValid(*waitlist))
+ {
/* reset standbyWait_us for each xact we wait for */
standbyWait_us = STANDBY_INITIAL_WAIT_US;
@@ -246,17 +243,16 @@ ResolveRecoveryConflictWithVirtualXIDs(VirtualTransactionId *waitlist,
}
}
- /* Reset ps display if we changed it */
- if (new_status)
- {
- set_ps_display(new_status, false);
- pfree(new_status);
- }
- pgstat_report_waiting(false);
-
/* The virtual transaction is gone now, wait for the next one */
waitlist++;
}
+
+ /* Reset ps display if we changed it */
+ if (new_status)
+ {
+ set_ps_display(new_status, false);
+ pfree(new_status);
+ }
}
void