mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
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
This commit is contained in:
@ -21,7 +21,6 @@
|
|||||||
#include "access/xact.h"
|
#include "access/xact.h"
|
||||||
#include "access/xlog.h"
|
#include "access/xlog.h"
|
||||||
#include "miscadmin.h"
|
#include "miscadmin.h"
|
||||||
#include "pgstat.h"
|
|
||||||
#include "storage/bufmgr.h"
|
#include "storage/bufmgr.h"
|
||||||
#include "storage/lmgr.h"
|
#include "storage/lmgr.h"
|
||||||
#include "storage/proc.h"
|
#include "storage/proc.h"
|
||||||
@ -191,16 +190,14 @@ static void
|
|||||||
ResolveRecoveryConflictWithVirtualXIDs(VirtualTransactionId *waitlist,
|
ResolveRecoveryConflictWithVirtualXIDs(VirtualTransactionId *waitlist,
|
||||||
ProcSignalReason reason)
|
ProcSignalReason reason)
|
||||||
{
|
{
|
||||||
|
TimestampTz waitStart;
|
||||||
|
char *new_status;
|
||||||
|
|
||||||
|
waitStart = GetCurrentTimestamp();
|
||||||
|
new_status = NULL; /* we haven't changed the ps display */
|
||||||
|
|
||||||
while (VirtualTransactionIdIsValid(*waitlist))
|
while (VirtualTransactionIdIsValid(*waitlist))
|
||||||
{
|
{
|
||||||
TimestampTz waitStart;
|
|
||||||
char *new_status;
|
|
||||||
|
|
||||||
pgstat_report_waiting(true);
|
|
||||||
|
|
||||||
waitStart = GetCurrentTimestamp();
|
|
||||||
new_status = NULL; /* we haven't changed the ps display */
|
|
||||||
|
|
||||||
/* reset standbyWait_us for each xact we wait for */
|
/* reset standbyWait_us for each xact we wait for */
|
||||||
standbyWait_us = STANDBY_INITIAL_WAIT_US;
|
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 */
|
/* The virtual transaction is gone now, wait for the next one */
|
||||||
waitlist++;
|
waitlist++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Reset ps display if we changed it */
|
||||||
|
if (new_status)
|
||||||
|
{
|
||||||
|
set_ps_display(new_status, false);
|
||||||
|
pfree(new_status);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Reference in New Issue
Block a user