mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Add ProcArrayGroupUpdate wait event.
Discussion: http://postgr.es/m/CA+TgmobgWHcXDcChX2+BqJDk2dkPVF85ZrJFhUyHHQmw8diTpA@mail.gmail.com
This commit is contained in:
@ -3560,6 +3560,9 @@ pgstat_get_wait_ipc(WaitEventIPC w)
|
||||
case WAIT_EVENT_PARALLEL_BITMAP_SCAN:
|
||||
event_name = "ParallelBitmapScan";
|
||||
break;
|
||||
case WAIT_EVENT_PROCARRAY_GROUP_UPDATE:
|
||||
event_name = "ProcArrayGroupUpdate";
|
||||
break;
|
||||
case WAIT_EVENT_SAFE_SNAPSHOT:
|
||||
event_name = "SafeSnapshot";
|
||||
break;
|
||||
|
@ -53,6 +53,7 @@
|
||||
#include "access/xlog.h"
|
||||
#include "catalog/catalog.h"
|
||||
#include "miscadmin.h"
|
||||
#include "pgstat.h"
|
||||
#include "storage/proc.h"
|
||||
#include "storage/procarray.h"
|
||||
#include "storage/spin.h"
|
||||
@ -513,6 +514,7 @@ ProcArrayGroupClearXid(PGPROC *proc, TransactionId latestXid)
|
||||
int extraWaits = 0;
|
||||
|
||||
/* Sleep until the leader clears our XID. */
|
||||
pgstat_report_wait_start(WAIT_EVENT_PROCARRAY_GROUP_UPDATE);
|
||||
for (;;)
|
||||
{
|
||||
/* acts as a read barrier */
|
||||
@ -521,6 +523,7 @@ ProcArrayGroupClearXid(PGPROC *proc, TransactionId latestXid)
|
||||
break;
|
||||
extraWaits++;
|
||||
}
|
||||
pgstat_report_wait_end();
|
||||
|
||||
Assert(pg_atomic_read_u32(&proc->procArrayGroupNext) == INVALID_PGPROCNO);
|
||||
|
||||
|
@ -808,6 +808,7 @@ typedef enum
|
||||
WAIT_EVENT_MQ_SEND,
|
||||
WAIT_EVENT_PARALLEL_FINISH,
|
||||
WAIT_EVENT_PARALLEL_BITMAP_SCAN,
|
||||
WAIT_EVENT_PROCARRAY_GROUP_UPDATE,
|
||||
WAIT_EVENT_SAFE_SNAPSHOT,
|
||||
WAIT_EVENT_SYNC_REP,
|
||||
WAIT_EVENT_LOGICAL_SYNC_DATA,
|
||||
|
Reference in New Issue
Block a user