Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 611fed3

Browse files
committed
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
1 parent df142bf commit 611fed3

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

src/backend/storage/ipc/standby.c

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "access/xact.h"
2222
#include "access/xlog.h"
2323
#include "miscadmin.h"
24-
#include "pgstat.h"
2524
#include "storage/bufmgr.h"
2625
#include "storage/lmgr.h"
2726
#include "storage/proc.h"
@@ -191,16 +190,14 @@ static void
191190
ResolveRecoveryConflictWithVirtualXIDs(VirtualTransactionId *waitlist,
192191
ProcSignalReason reason)
193192
{
194-
while (VirtualTransactionIdIsValid(*waitlist))
195-
{
196-
TimestampTz waitStart;
197-
char *new_status;
198-
199-
pgstat_report_waiting(true);
193+
TimestampTz waitStart;
194+
char *new_status;
200195

201-
waitStart = GetCurrentTimestamp();
202-
new_status = NULL; /* we haven't changed the ps display */
196+
waitStart = GetCurrentTimestamp();
197+
new_status = NULL; /* we haven't changed the ps display */
203198

199+
while (VirtualTransactionIdIsValid(*waitlist))
200+
{
204201
/* reset standbyWait_us for each xact we wait for */
205202
standbyWait_us = STANDBY_INITIAL_WAIT_US;
206203

@@ -246,17 +243,16 @@ ResolveRecoveryConflictWithVirtualXIDs(VirtualTransactionId *waitlist,
246243
}
247244
}
248245

249-
/* Reset ps display if we changed it */
250-
if (new_status)
251-
{
252-
set_ps_display(new_status, false);
253-
pfree(new_status);
254-
}
255-
pgstat_report_waiting(false);
256-
257246
/* The virtual transaction is gone now, wait for the next one */
258247
waitlist++;
259248
}
249+
250+
/* Reset ps display if we changed it */
251+
if (new_status)
252+
{
253+
set_ps_display(new_status, false);
254+
pfree(new_status);
255+
}
260256
}
261257

262258
void

0 commit comments

Comments
 (0)