On 2021/03/18 18:48, Fujii Masao wrote:
WAIT_EVENT_WAL_RECEIVER_WAIT_START is waiting for waiting for starup
process to kick me. So it may be either IPC or Activity. Since
walreceiver hasn't sent anything to startup, so it's activity, rather
than IPC. However, the behavior can be said that it convey a piece of
information from startup to wal receiver so it also can be said to be
an IPC. (That is the reason why I don't object for IPC.)
IMO this should be IPC because walreceiver is mainly waiting for the
interaction with the startup process, during this wait event. Since you can
live with IPC, probably our consensus is to use IPC?
If this is ok, I'd like to apply the attached patch at first.
This patch changes the type of WAIT_EVENT_WAL_RECEIVER_WAIT_START
from Client to IPC.
BTW, I found that recently WalrcvExit wait event was introduced.
But this name is not consistent with other events. I'm thinking that
it's better to rename it to WalReceiverExit.
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
From f5a8c8866fc8c750181109a7b3aae9b90e795668 Mon Sep 17 00:00:00 2001
From: Fujii Masao <fu...@postgresql.org>
Date: Fri, 19 Mar 2021 13:56:27 +0900
Subject: [PATCH] Change the type of WalReceiverWaitStart wait event from
Client to IPC.
Previously the type of this wait event was Client. But while this
wait event is being reported, walreceiver process is waiting for
the startup process to set initial data for streaming replication.
It's not waiting for any activity on a socket connected to a user
application or walsender. So this commit changes the type for
WalReceiverWaitStart wait event to IPC.
Author: Fujii Masao
Reviewed-by: Kyotaro Horiguchi
Discussion:
https://postgr.es/m/cdacc27c-37ff-f1a4-20e2-ce19933ab...@oss.nttdata.com
---
doc/src/sgml/monitoring.sgml | 10 +++++-----
src/backend/postmaster/pgstat.c | 6 +++---
src/include/pgstat.h | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index db4b4e460c..19540206f9 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -1171,11 +1171,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss
11:34 0:00 postgres: ser
<entry><literal>SSLOpenServer</literal></entry>
<entry>Waiting for SSL while attempting connection.</entry>
</row>
- <row>
- <entry><literal>WalReceiverWaitStart</literal></entry>
- <entry>Waiting for startup process to send initial data for streaming
- replication.</entry>
- </row>
<row>
<entry><literal>WalSenderWaitForWAL</literal></entry>
<entry>Waiting for WAL to be flushed in WAL sender process.</entry>
@@ -1771,6 +1766,11 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss
11:34 0:00 postgres: ser
<entry><literal>WalrcvExit</literal></entry>
<entry>Waiting for the walreceiver to exit.</entry>
</row>
+ <row>
+ <entry><literal>WalReceiverWaitStart</literal></entry>
+ <entry>Waiting for startup process to send initial data for streaming
+ replication.</entry>
+ </row>
<row>
<entry><literal>XactGroupUpdate</literal></entry>
<entry>Waiting for the group leader to update transaction status at
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index 208a33692f..b7af7c2707 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -3970,9 +3970,6 @@ pgstat_get_wait_client(WaitEventClient w)
case WAIT_EVENT_SSL_OPEN_SERVER:
event_name = "SSLOpenServer";
break;
- case WAIT_EVENT_WAL_RECEIVER_WAIT_START:
- event_name = "WalReceiverWaitStart";
- break;
case WAIT_EVENT_WAL_SENDER_WAIT_WAL:
event_name = "WalSenderWaitForWAL";
break;
@@ -4127,6 +4124,9 @@ pgstat_get_wait_ipc(WaitEventIPC w)
case WAIT_EVENT_WALRCV_EXIT:
event_name = "WalrcvExit";
break;
+ case WAIT_EVENT_WAL_RECEIVER_WAIT_START:
+ event_name = "WalReceiverWaitStart";
+ break;
case WAIT_EVENT_XACT_GROUP_UPDATE:
event_name = "XactGroupUpdate";
break;
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index be43c04802..2c82313550 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -953,7 +953,6 @@ typedef enum
WAIT_EVENT_LIBPQWALRECEIVER_CONNECT,
WAIT_EVENT_LIBPQWALRECEIVER_RECEIVE,
WAIT_EVENT_SSL_OPEN_SERVER,
- WAIT_EVENT_WAL_RECEIVER_WAIT_START,
WAIT_EVENT_WAL_SENDER_WAIT_WAL,
WAIT_EVENT_WAL_SENDER_WRITE_DATA,
} WaitEventClient;
@@ -1010,6 +1009,7 @@ typedef enum
WAIT_EVENT_SAFE_SNAPSHOT,
WAIT_EVENT_SYNC_REP,
WAIT_EVENT_WALRCV_EXIT,
+ WAIT_EVENT_WAL_RECEIVER_WAIT_START,
WAIT_EVENT_XACT_GROUP_UPDATE
} WaitEventIPC;
--
2.27.0