Commit 1d253bae authored by Fujii Masao's avatar Fujii Masao

Rename the recovery-related wait events.

This commit renames RecoveryWalAll and RecoveryWalStream wait events to
RecoveryWalStream and RecoveryRetrieveRetryInterval, respectively,
in order to make the names and what they are more consistent. For example,
previously RecoveryWalAll was reported as a wait event while the recovery
was waiting for WAL from a stream, and which was confusing because the name
was very different from the situation where the wait actually could happen.

The names of macro variables for those wait events also are renamed
accordingly.

This commit also changes the category of RecoveryRetrieveRetryInterval to
Timeout from Activity because the wait event is reported while waiting based
on wal_retrieve_retry_interval.

Author: Fujii Masao
Reviewed-by: Kyotaro Horiguchi, Atsushi Torikoshi
Discussion: https://postgr.es/m/124997ee-096a-5d09-d8da-2c7a57d0816e@oss.nttdata.com
parent 72e78d83
...@@ -1244,7 +1244,7 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser ...@@ -1244,7 +1244,7 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
<entry>Waiting to acquire a pin on a buffer.</entry> <entry>Waiting to acquire a pin on a buffer.</entry>
</row> </row>
<row> <row>
<entry morerows="13"><literal>Activity</literal></entry> <entry morerows="12"><literal>Activity</literal></entry>
<entry><literal>ArchiverMain</literal></entry> <entry><literal>ArchiverMain</literal></entry>
<entry>Waiting in main loop of the archiver process.</entry> <entry>Waiting in main loop of the archiver process.</entry>
</row> </row>
...@@ -1276,17 +1276,9 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser ...@@ -1276,17 +1276,9 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
<entry><literal>PgStatMain</literal></entry> <entry><literal>PgStatMain</literal></entry>
<entry>Waiting in main loop of the statistics collector process.</entry> <entry>Waiting in main loop of the statistics collector process.</entry>
</row> </row>
<row>
<entry><literal>RecoveryWalAll</literal></entry>
<entry>Waiting for WAL from a stream at recovery.</entry>
</row>
<row> <row>
<entry><literal>RecoveryWalStream</literal></entry> <entry><literal>RecoveryWalStream</literal></entry>
<entry> <entry>Waiting for WAL from a stream at recovery.</entry>
Waiting when WAL data is not available from any kind of sources
(local, archive or stream) before trying again to retrieve WAL data,
at recovery.
</entry>
</row> </row>
<row> <row>
<entry><literal>SysLoggerMain</literal></entry> <entry><literal>SysLoggerMain</literal></entry>
...@@ -1496,7 +1488,7 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser ...@@ -1496,7 +1488,7 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
<entry>Waiting for confirmation from remote server during synchronous replication.</entry> <entry>Waiting for confirmation from remote server during synchronous replication.</entry>
</row> </row>
<row> <row>
<entry morerows="2"><literal>Timeout</literal></entry> <entry morerows="3"><literal>Timeout</literal></entry>
<entry><literal>BaseBackupThrottle</literal></entry> <entry><literal>BaseBackupThrottle</literal></entry>
<entry>Waiting during base backup when throttling activity.</entry> <entry>Waiting during base backup when throttling activity.</entry>
</row> </row>
...@@ -1508,6 +1500,14 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser ...@@ -1508,6 +1500,14 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
<entry><literal>RecoveryApplyDelay</literal></entry> <entry><literal>RecoveryApplyDelay</literal></entry>
<entry>Waiting to apply WAL at recovery because it is delayed.</entry> <entry>Waiting to apply WAL at recovery because it is delayed.</entry>
</row> </row>
<row>
<entry><literal>RecoveryRetrieveRetryInterval</literal></entry>
<entry>
Waiting when WAL data is not available from any kind of sources
(<filename>pg_wal</filename>, archive or stream) before trying
again to retrieve WAL data, at recovery.
</entry>
</row>
<row> <row>
<entry morerows="68"><literal>IO</literal></entry> <entry morerows="68"><literal>IO</literal></entry>
<entry><literal>BufFileRead</literal></entry> <entry><literal>BufFileRead</literal></entry>
......
...@@ -12031,7 +12031,7 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess, ...@@ -12031,7 +12031,7 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
WL_LATCH_SET | WL_TIMEOUT | WL_LATCH_SET | WL_TIMEOUT |
WL_EXIT_ON_PM_DEATH, WL_EXIT_ON_PM_DEATH,
wait_time, wait_time,
WAIT_EVENT_RECOVERY_WAL_STREAM); WAIT_EVENT_RECOVERY_RETRIEVE_RETRY_INTERVAL);
ResetLatch(&XLogCtl->recoveryWakeupLatch); ResetLatch(&XLogCtl->recoveryWakeupLatch);
now = GetCurrentTimestamp(); now = GetCurrentTimestamp();
} }
...@@ -12221,7 +12221,7 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess, ...@@ -12221,7 +12221,7 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
(void) WaitLatch(&XLogCtl->recoveryWakeupLatch, (void) WaitLatch(&XLogCtl->recoveryWakeupLatch,
WL_LATCH_SET | WL_TIMEOUT | WL_LATCH_SET | WL_TIMEOUT |
WL_EXIT_ON_PM_DEATH, WL_EXIT_ON_PM_DEATH,
5000L, WAIT_EVENT_RECOVERY_WAL_ALL); 5000L, WAIT_EVENT_RECOVERY_WAL_STREAM);
ResetLatch(&XLogCtl->recoveryWakeupLatch); ResetLatch(&XLogCtl->recoveryWakeupLatch);
break; break;
} }
......
...@@ -3602,9 +3602,6 @@ pgstat_get_wait_activity(WaitEventActivity w) ...@@ -3602,9 +3602,6 @@ pgstat_get_wait_activity(WaitEventActivity w)
case WAIT_EVENT_PGSTAT_MAIN: case WAIT_EVENT_PGSTAT_MAIN:
event_name = "PgStatMain"; event_name = "PgStatMain";
break; break;
case WAIT_EVENT_RECOVERY_WAL_ALL:
event_name = "RecoveryWalAll";
break;
case WAIT_EVENT_RECOVERY_WAL_STREAM: case WAIT_EVENT_RECOVERY_WAL_STREAM:
event_name = "RecoveryWalStream"; event_name = "RecoveryWalStream";
break; break;
...@@ -3824,6 +3821,9 @@ pgstat_get_wait_timeout(WaitEventTimeout w) ...@@ -3824,6 +3821,9 @@ pgstat_get_wait_timeout(WaitEventTimeout w)
case WAIT_EVENT_RECOVERY_APPLY_DELAY: case WAIT_EVENT_RECOVERY_APPLY_DELAY:
event_name = "RecoveryApplyDelay"; event_name = "RecoveryApplyDelay";
break; break;
case WAIT_EVENT_RECOVERY_RETRIEVE_RETRY_INTERVAL:
event_name = "RecoveryRetrieveRetryInterval";
break;
/* no default case, so that compiler will warn */ /* no default case, so that compiler will warn */
} }
......
...@@ -761,7 +761,6 @@ typedef enum ...@@ -761,7 +761,6 @@ typedef enum
WAIT_EVENT_LOGICAL_APPLY_MAIN, WAIT_EVENT_LOGICAL_APPLY_MAIN,
WAIT_EVENT_LOGICAL_LAUNCHER_MAIN, WAIT_EVENT_LOGICAL_LAUNCHER_MAIN,
WAIT_EVENT_PGSTAT_MAIN, WAIT_EVENT_PGSTAT_MAIN,
WAIT_EVENT_RECOVERY_WAL_ALL,
WAIT_EVENT_RECOVERY_WAL_STREAM, WAIT_EVENT_RECOVERY_WAL_STREAM,
WAIT_EVENT_SYSLOGGER_MAIN, WAIT_EVENT_SYSLOGGER_MAIN,
WAIT_EVENT_WAL_RECEIVER_MAIN, WAIT_EVENT_WAL_RECEIVER_MAIN,
...@@ -848,7 +847,8 @@ typedef enum ...@@ -848,7 +847,8 @@ typedef enum
{ {
WAIT_EVENT_BASE_BACKUP_THROTTLE = PG_WAIT_TIMEOUT, WAIT_EVENT_BASE_BACKUP_THROTTLE = PG_WAIT_TIMEOUT,
WAIT_EVENT_PG_SLEEP, WAIT_EVENT_PG_SLEEP,
WAIT_EVENT_RECOVERY_APPLY_DELAY WAIT_EVENT_RECOVERY_APPLY_DELAY,
WAIT_EVENT_RECOVERY_RETRIEVE_RETRY_INTERVAL
} WaitEventTimeout; } WaitEventTimeout;
/* ---------- /* ----------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment