Change the type of WalReceiverWaitStart wait event from Client to IPC.
authorFujii Masao <fujii@postgresql.org>
Tue, 23 Mar 2021 01:09:42 +0000 (10:09 +0900)
committerFujii Masao <fujii@postgresql.org>
Tue, 23 Mar 2021 01:09:42 +0000 (10:09 +0900)
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-ce19933abfcc@oss.nttdata.com

doc/src/sgml/monitoring.sgml
src/backend/postmaster/pgstat.c
src/include/pgstat.h

index db4b4e460c0004672eb2379a1188029b8adc5180..19540206f97e0c3de1524478c87e20c3ee2c5ade 100644 (file)
@@ -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
index 208a33692f353edbc0e022cdf82ef45ea1004578..b7af7c2707af73ac22932ee93e2919a38af1a18e 100644 (file)
@@ -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;
index be43c04802897d6b4f7f64c4383cb8d513dd88c1..2c823135509b7630a8d36371b1f16f48b2d59936 100644 (file)
@@ -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;