index 0ebadf0d26d232835d4aa8e92e5e0f522c51ac1b..fd8b17ef8f6c38719a8e3bc0a8bb3dfcad9fbe9f 100644 (file)
@@ -1346,7 +1346,7 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
<entry>Waiting in an extension.</entry>
</row>
<row>
- <entry morerows="38"><literal>IPC</literal></entry>
+ <entry morerows="40"><literal>IPC</literal></entry>
<entry><literal>BackupWaitWalArchive</literal></entry>
<entry>Waiting for WAL files required for the backup to be successfully archived.</entry>
</row>
@@ -1482,6 +1482,14 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
<entry><literal>Promote</literal></entry>
<entry>Waiting for standby promotion.</entry>
</row>
+ <row>
+ <entry><literal>RecoveryConflictSnapshot</literal></entry>
+ <entry>Waiting for recovery conflict resolution on a vacuum cleanup.</entry>
+ </row>
+ <row>
+ <entry><literal>RecoveryConflictTablespace</literal></entry>
+ <entry>Waiting for recovery conflict resolution on dropping tablespace.</entry>
+ </row>
<row>
<entry><literal>RecoveryPause</literal></entry>
<entry>Waiting for recovery to be resumed.</entry>
index 08f695a98053002d6dd13d73a9162258fa582769..bdaf10a4b1f76cffe184ba66a2b334457b4aabb3 100644 (file)
@@ -43,7 +43,9 @@ int max_standby_streaming_delay = 30 * 1000;
static HTAB *RecoveryLockLists;
static void ResolveRecoveryConflictWithVirtualXIDs(VirtualTransactionId *waitlist,
- ProcSignalReason reason, bool report_waiting);
+ ProcSignalReason reason,
+ uint32 wait_event_info,
+ bool report_waiting);
static void SendRecoveryConflictWithBufferPin(ProcSignalReason reason);
static XLogRecPtr LogCurrentRunningXacts(RunningTransactions CurrRunningXacts);
static void LogAccessExclusiveLocks(int nlocks, xl_standby_lock *locks);
@@ -184,7 +186,7 @@ static int standbyWait_us = STANDBY_INITIAL_WAIT_US;
* more then we return true, if we can wait some more return false.
*/
static bool
-WaitExceedsMaxStandbyDelay(void)
+WaitExceedsMaxStandbyDelay(uint32 wait_event_info)
{
TimestampTz ltime;
/*
* Sleep a bit (this is essential to avoid busy-waiting).
*/
+ pgstat_report_wait_start(wait_event_info);
pg_usleep(standbyWait_us);
+ pgstat_report_wait_end();
/*
* Progressively increase the sleep times, but not to more than 1s, since
*/
static void
ResolveRecoveryConflictWithVirtualXIDs(VirtualTransactionId *waitlist,
- ProcSignalReason reason, bool report_waiting)
+ ProcSignalReason reason, uint32 wait_event_info,
+ bool report_waiting)
{
TimestampTz waitStart = 0;
char *new_status;
@@ -264,7 +269,7 @@ ResolveRecoveryConflictWithVirtualXIDs(VirtualTransactionId *waitlist,
}
/* Is it time to kill it? */
- if (WaitExceedsMaxStandbyDelay())
+ if (WaitExceedsMaxStandbyDelay(wait_event_info))
{
pid_t pid;
@@ -317,6 +322,7 @@ ResolveRecoveryConflictWithSnapshot(TransactionId latestRemovedXid, RelFileNode
ResolveRecoveryConflictWithVirtualXIDs(backends,
PROCSIG_RECOVERY_CONFLICT_SNAPSHOT,
+ WAIT_EVENT_RECOVERY_CONFLICT_SNAPSHOT,
true);
}
@@ -346,6 +352,7 @@ ResolveRecoveryConflictWithTablespace(Oid tsid)
InvalidOid);
ResolveRecoveryConflictWithVirtualXIDs(temp_file_users,
PROCSIG_RECOVERY_CONFLICT_TABLESPACE,
+ WAIT_EVENT_RECOVERY_CONFLICT_TABLESPACE,
true);
}
@@ -417,6 +424,7 @@ ResolveRecoveryConflictWithLock(LOCKTAG locktag)
*/
ResolveRecoveryConflictWithVirtualXIDs(backends,
PROCSIG_RECOVERY_CONFLICT_LOCK,
+ PG_WAIT_LOCK | locktag.locktag_type,
false);
}
else
index 9d351e771452e3abcd344e68d0287a4f50a0c950..b8041d9988046554c6fff4192b5bf1cdbce8f79f 100644 (file)
WAIT_EVENT_PARALLEL_FINISH,
WAIT_EVENT_PROCARRAY_GROUP_UPDATE,
WAIT_EVENT_PROMOTE,
+ WAIT_EVENT_RECOVERY_CONFLICT_SNAPSHOT,
+ WAIT_EVENT_RECOVERY_CONFLICT_TABLESPACE,
WAIT_EVENT_RECOVERY_PAUSE,
WAIT_EVENT_REPLICATION_ORIGIN_DROP,
WAIT_EVENT_REPLICATION_SLOT_DROP,