Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d4116a7

Browse files
committed
1 parent dbb2a93 commit d4116a7

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

doc/src/sgml/monitoring.sgml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1232,7 +1232,7 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
12321232
<entry>Waiting in an extension.</entry>
12331233
</row>
12341234
<row>
1235-
<entry morerows="11"><literal>IPC</></entry>
1235+
<entry morerows="12"><literal>IPC</></entry>
12361236
<entry><literal>BgWorkerShutdown</></entry>
12371237
<entry>Waiting for background worker to shut down.</entry>
12381238
</row>
@@ -1272,6 +1272,9 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
12721272
<entry><literal>ParallelBitmapPopulate</></entry>
12731273
<entry>Waiting for the leader to populate the TidBitmap.</entry>
12741274
</row>
1275+
<row>
1276+
<entry><literal>ProcArrayGroupUpdate</></entry>
1277+
<entry>Waiting for group leader to clear transaction id at transaction end.</entry>
12751278
<row>
12761279
<entry><literal>SafeSnapshot</></entry>
12771280
<entry>Waiting for a snapshot for a <literal>READ ONLY DEFERRABLE</> transaction.</entry>

src/backend/postmaster/pgstat.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3560,6 +3560,9 @@ pgstat_get_wait_ipc(WaitEventIPC w)
35603560
case WAIT_EVENT_PARALLEL_BITMAP_SCAN:
35613561
event_name = "ParallelBitmapScan";
35623562
break;
3563+
case WAIT_EVENT_PROCARRAY_GROUP_UPDATE:
3564+
event_name = "ProcArrayGroupUpdate";
3565+
break;
35633566
case WAIT_EVENT_SAFE_SNAPSHOT:
35643567
event_name = "SafeSnapshot";
35653568
break;

src/backend/storage/ipc/procarray.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
#include "access/xlog.h"
5454
#include "catalog/catalog.h"
5555
#include "miscadmin.h"
56+
#include "pgstat.h"
5657
#include "storage/proc.h"
5758
#include "storage/procarray.h"
5859
#include "storage/spin.h"
@@ -513,6 +514,7 @@ ProcArrayGroupClearXid(PGPROC *proc, TransactionId latestXid)
513514
int extraWaits = 0;
514515

515516
/* Sleep until the leader clears our XID. */
517+
pgstat_report_wait_start(WAIT_EVENT_PROCARRAY_GROUP_UPDATE);
516518
for (;;)
517519
{
518520
/* acts as a read barrier */
@@ -521,6 +523,7 @@ ProcArrayGroupClearXid(PGPROC *proc, TransactionId latestXid)
521523
break;
522524
extraWaits++;
523525
}
526+
pgstat_report_wait_end();
524527

525528
Assert(pg_atomic_read_u32(&proc->procArrayGroupNext) == INVALID_PGPROCNO);
526529

src/include/pgstat.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,7 @@ typedef enum
808808
WAIT_EVENT_MQ_SEND,
809809
WAIT_EVENT_PARALLEL_FINISH,
810810
WAIT_EVENT_PARALLEL_BITMAP_SCAN,
811+
WAIT_EVENT_PROCARRAY_GROUP_UPDATE,
811812
WAIT_EVENT_SAFE_SNAPSHOT,
812813
WAIT_EVENT_SYNC_REP,
813814
WAIT_EVENT_LOGICAL_SYNC_DATA,

0 commit comments

Comments
 (0)