Commit 3048898e authored by Tom Lane's avatar Tom Lane

Mop-up for wait event naming issues.

Synchronize the event names for parallel hash join waits with other
event names, by getting rid of the slashes and dropping "-ing"
suffixes.  Rename ClogGroupUpdate to XactGroupUpdate, to match the
new SLRU name.  Move the ProcSignalBarrier event to the IPC category;
it doesn't belong under IO.

Also a bit more wordsmithing in the wait event documentation tables.

Discussion: https://postgr.es/m/4505.1589640417@sss.pgh.pa.us
parent 2c8dd05d
This diff is collapsed.
......@@ -473,7 +473,7 @@ TransactionGroupUpdateXidStatus(TransactionId xid, XidStatus status,
int extraWaits = 0;
/* Sleep until the leader updates our XID status. */
pgstat_report_wait_start(WAIT_EVENT_CLOG_GROUP_UPDATE);
pgstat_report_wait_start(WAIT_EVENT_XACT_GROUP_UPDATE);
for (;;)
{
/* acts as a read barrier */
......
......@@ -255,7 +255,7 @@ MultiExecParallelHash(HashState *node)
* ExecHashTableCreate(), or someone else is doing that. Either
* way, wait for everyone to arrive here so we can proceed.
*/
BarrierArriveAndWait(build_barrier, WAIT_EVENT_HASH_BUILD_ALLOCATING);
BarrierArriveAndWait(build_barrier, WAIT_EVENT_HASH_BUILD_ALLOCATE);
/* Fall through. */
case PHJ_BUILD_HASHING_INNER:
......@@ -311,7 +311,7 @@ MultiExecParallelHash(HashState *node)
* counters.
*/
if (BarrierArriveAndWait(build_barrier,
WAIT_EVENT_HASH_BUILD_HASHING_INNER))
WAIT_EVENT_HASH_BUILD_HASH_INNER))
{
/*
* Elect one backend to disable any further growth. Batches
......@@ -603,7 +603,7 @@ ExecHashTableCreate(HashState *state, List *hashOperators, List *hashCollations,
* backend will be elected to do that now if necessary.
*/
if (BarrierPhase(build_barrier) == PHJ_BUILD_ELECTING &&
BarrierArriveAndWait(build_barrier, WAIT_EVENT_HASH_BUILD_ELECTING))
BarrierArriveAndWait(build_barrier, WAIT_EVENT_HASH_BUILD_ELECT))
{
pstate->nbatch = nbatch;
pstate->space_allowed = space_allowed;
......@@ -1076,7 +1076,7 @@ ExecParallelHashIncreaseNumBatches(HashJoinTable hashtable)
* tuples.
*/
if (BarrierArriveAndWait(&pstate->grow_batches_barrier,
WAIT_EVENT_HASH_GROW_BATCHES_ELECTING))
WAIT_EVENT_HASH_GROW_BATCHES_ELECT))
{
dsa_pointer_atomic *buckets;
ParallelHashJoinBatch *old_batch0;
......@@ -1186,7 +1186,7 @@ ExecParallelHashIncreaseNumBatches(HashJoinTable hashtable)
case PHJ_GROW_BATCHES_ALLOCATING:
/* Wait for the above to be finished. */
BarrierArriveAndWait(&pstate->grow_batches_barrier,
WAIT_EVENT_HASH_GROW_BATCHES_ALLOCATING);
WAIT_EVENT_HASH_GROW_BATCHES_ALLOCATE);
/* Fall through. */
case PHJ_GROW_BATCHES_REPARTITIONING:
......@@ -1199,7 +1199,7 @@ ExecParallelHashIncreaseNumBatches(HashJoinTable hashtable)
ExecParallelHashMergeCounters(hashtable);
/* Wait for the above to be finished. */
BarrierArriveAndWait(&pstate->grow_batches_barrier,
WAIT_EVENT_HASH_GROW_BATCHES_REPARTITIONING);
WAIT_EVENT_HASH_GROW_BATCHES_REPARTITION);
/* Fall through. */
case PHJ_GROW_BATCHES_DECIDING:
......@@ -1210,7 +1210,7 @@ ExecParallelHashIncreaseNumBatches(HashJoinTable hashtable)
* not helping.
*/
if (BarrierArriveAndWait(&pstate->grow_batches_barrier,
WAIT_EVENT_HASH_GROW_BATCHES_DECIDING))
WAIT_EVENT_HASH_GROW_BATCHES_DECIDE))
{
bool space_exhausted = false;
bool extreme_skew_detected = false;
......@@ -1260,7 +1260,7 @@ ExecParallelHashIncreaseNumBatches(HashJoinTable hashtable)
case PHJ_GROW_BATCHES_FINISHING:
/* Wait for the above to complete. */
BarrierArriveAndWait(&pstate->grow_batches_barrier,
WAIT_EVENT_HASH_GROW_BATCHES_FINISHING);
WAIT_EVENT_HASH_GROW_BATCHES_FINISH);
}
}
......@@ -1509,7 +1509,7 @@ ExecParallelHashIncreaseNumBuckets(HashJoinTable hashtable)
case PHJ_GROW_BUCKETS_ELECTING:
/* Elect one participant to prepare to increase nbuckets. */
if (BarrierArriveAndWait(&pstate->grow_buckets_barrier,
WAIT_EVENT_HASH_GROW_BUCKETS_ELECTING))
WAIT_EVENT_HASH_GROW_BUCKETS_ELECT))
{
size_t size;
dsa_pointer_atomic *buckets;
......@@ -1538,7 +1538,7 @@ ExecParallelHashIncreaseNumBuckets(HashJoinTable hashtable)
case PHJ_GROW_BUCKETS_ALLOCATING:
/* Wait for the above to complete. */
BarrierArriveAndWait(&pstate->grow_buckets_barrier,
WAIT_EVENT_HASH_GROW_BUCKETS_ALLOCATING);
WAIT_EVENT_HASH_GROW_BUCKETS_ALLOCATE);
/* Fall through. */
case PHJ_GROW_BUCKETS_REINSERTING:
......@@ -1573,7 +1573,7 @@ ExecParallelHashIncreaseNumBuckets(HashJoinTable hashtable)
CHECK_FOR_INTERRUPTS();
}
BarrierArriveAndWait(&pstate->grow_buckets_barrier,
WAIT_EVENT_HASH_GROW_BUCKETS_REINSERTING);
WAIT_EVENT_HASH_GROW_BUCKETS_REINSERT);
}
}
......
......@@ -327,7 +327,7 @@ ExecHashJoinImpl(PlanState *pstate, bool parallel)
if (hashtable->nbatch > 1)
ExecParallelHashJoinPartitionOuter(node);
BarrierArriveAndWait(build_barrier,
WAIT_EVENT_HASH_BUILD_HASHING_OUTER);
WAIT_EVENT_HASH_BUILD_HASH_OUTER);
}
Assert(BarrierPhase(build_barrier) == PHJ_BUILD_DONE);
......@@ -1135,14 +1135,14 @@ ExecParallelHashJoinNewBatch(HashJoinState *hjstate)
/* One backend allocates the hash table. */
if (BarrierArriveAndWait(batch_barrier,
WAIT_EVENT_HASH_BATCH_ELECTING))
WAIT_EVENT_HASH_BATCH_ELECT))
ExecParallelHashTableAlloc(hashtable, batchno);
/* Fall through. */
case PHJ_BATCH_ALLOCATING:
/* Wait for allocation to complete. */
BarrierArriveAndWait(batch_barrier,
WAIT_EVENT_HASH_BATCH_ALLOCATING);
WAIT_EVENT_HASH_BATCH_ALLOCATE);
/* Fall through. */
case PHJ_BATCH_LOADING:
......@@ -1162,7 +1162,7 @@ ExecParallelHashJoinNewBatch(HashJoinState *hjstate)
}
sts_end_parallel_scan(inner_tuples);
BarrierArriveAndWait(batch_barrier,
WAIT_EVENT_HASH_BATCH_LOADING);
WAIT_EVENT_HASH_BATCH_LOAD);
/* Fall through. */
case PHJ_BATCH_PROBING:
......
......@@ -3774,56 +3774,53 @@ pgstat_get_wait_ipc(WaitEventIPC w)
case WAIT_EVENT_CHECKPOINT_START:
event_name = "CheckpointStart";
break;
case WAIT_EVENT_CLOG_GROUP_UPDATE:
event_name = "ClogGroupUpdate";
break;
case WAIT_EVENT_EXECUTE_GATHER:
event_name = "ExecuteGather";
break;
case WAIT_EVENT_HASH_BATCH_ALLOCATING:
event_name = "Hash/Batch/Allocating";
case WAIT_EVENT_HASH_BATCH_ALLOCATE:
event_name = "HashBatchAllocate";
break;
case WAIT_EVENT_HASH_BATCH_ELECTING:
event_name = "Hash/Batch/Electing";
case WAIT_EVENT_HASH_BATCH_ELECT:
event_name = "HashBatchElect";
break;
case WAIT_EVENT_HASH_BATCH_LOADING:
event_name = "Hash/Batch/Loading";
case WAIT_EVENT_HASH_BATCH_LOAD:
event_name = "HashBatchLoad";
break;
case WAIT_EVENT_HASH_BUILD_ALLOCATING:
event_name = "Hash/Build/Allocating";
case WAIT_EVENT_HASH_BUILD_ALLOCATE:
event_name = "HashBuildAllocate";
break;
case WAIT_EVENT_HASH_BUILD_ELECTING:
event_name = "Hash/Build/Electing";
case WAIT_EVENT_HASH_BUILD_ELECT:
event_name = "HashBuildElect";
break;
case WAIT_EVENT_HASH_BUILD_HASHING_INNER:
event_name = "Hash/Build/HashingInner";
case WAIT_EVENT_HASH_BUILD_HASH_INNER:
event_name = "HashBuildHashInner";
break;
case WAIT_EVENT_HASH_BUILD_HASHING_OUTER:
event_name = "Hash/Build/HashingOuter";
case WAIT_EVENT_HASH_BUILD_HASH_OUTER:
event_name = "HashBuildHashOuter";
break;
case WAIT_EVENT_HASH_GROW_BATCHES_ALLOCATING:
event_name = "Hash/GrowBatches/Allocating";
case WAIT_EVENT_HASH_GROW_BATCHES_ALLOCATE:
event_name = "HashGrowBatchesAllocate";
break;
case WAIT_EVENT_HASH_GROW_BATCHES_DECIDING:
event_name = "Hash/GrowBatches/Deciding";
case WAIT_EVENT_HASH_GROW_BATCHES_DECIDE:
event_name = "HashGrowBatchesDecide";
break;
case WAIT_EVENT_HASH_GROW_BATCHES_ELECTING:
event_name = "Hash/GrowBatches/Electing";
case WAIT_EVENT_HASH_GROW_BATCHES_ELECT:
event_name = "HashGrowBatchesElect";
break;
case WAIT_EVENT_HASH_GROW_BATCHES_FINISHING:
event_name = "Hash/GrowBatches/Finishing";
case WAIT_EVENT_HASH_GROW_BATCHES_FINISH:
event_name = "HashGrowBatchesFinish";
break;
case WAIT_EVENT_HASH_GROW_BATCHES_REPARTITIONING:
event_name = "Hash/GrowBatches/Repartitioning";
case WAIT_EVENT_HASH_GROW_BATCHES_REPARTITION:
event_name = "HashGrowBatchesRepartition";
break;
case WAIT_EVENT_HASH_GROW_BUCKETS_ALLOCATING:
event_name = "Hash/GrowBuckets/Allocating";
case WAIT_EVENT_HASH_GROW_BUCKETS_ALLOCATE:
event_name = "HashGrowBucketsAllocate";
break;
case WAIT_EVENT_HASH_GROW_BUCKETS_ELECTING:
event_name = "Hash/GrowBuckets/Electing";
case WAIT_EVENT_HASH_GROW_BUCKETS_ELECT:
event_name = "HashGrowBucketsElect";
break;
case WAIT_EVENT_HASH_GROW_BUCKETS_REINSERTING:
event_name = "Hash/GrowBuckets/Reinserting";
case WAIT_EVENT_HASH_GROW_BUCKETS_REINSERT:
event_name = "HashGrowBucketsReinsert";
break;
case WAIT_EVENT_LOGICAL_SYNC_DATA:
event_name = "LogicalSyncData";
......@@ -3855,6 +3852,9 @@ pgstat_get_wait_ipc(WaitEventIPC w)
case WAIT_EVENT_PROCARRAY_GROUP_UPDATE:
event_name = "ProcArrayGroupUpdate";
break;
case WAIT_EVENT_PROC_SIGNAL_BARRIER:
event_name = "ProcSignalBarrier";
break;
case WAIT_EVENT_PROMOTE:
event_name = "Promote";
break;
......@@ -3879,6 +3879,9 @@ pgstat_get_wait_ipc(WaitEventIPC w)
case WAIT_EVENT_SYNC_REP:
event_name = "SyncRep";
break;
case WAIT_EVENT_XACT_GROUP_UPDATE:
event_name = "XactGroupUpdate";
break;
/* no default case, so that compiler will warn */
}
......@@ -4025,9 +4028,6 @@ pgstat_get_wait_io(WaitEventIO w)
case WAIT_EVENT_LOGICAL_REWRITE_WRITE:
event_name = "LogicalRewriteWrite";
break;
case WAIT_EVENT_PROC_SIGNAL_BARRIER:
event_name = "ProcSignalBarrier";
break;
case WAIT_EVENT_RELATION_MAP_READ:
event_name = "RelationMapRead";
break;
......
......@@ -850,25 +850,24 @@ typedef enum
WAIT_EVENT_BGWORKER_SHUTDOWN,
WAIT_EVENT_BGWORKER_STARTUP,
WAIT_EVENT_BTREE_PAGE,
WAIT_EVENT_CLOG_GROUP_UPDATE,
WAIT_EVENT_CHECKPOINT_DONE,
WAIT_EVENT_CHECKPOINT_START,
WAIT_EVENT_EXECUTE_GATHER,
WAIT_EVENT_HASH_BATCH_ALLOCATING,
WAIT_EVENT_HASH_BATCH_ELECTING,
WAIT_EVENT_HASH_BATCH_LOADING,
WAIT_EVENT_HASH_BUILD_ALLOCATING,
WAIT_EVENT_HASH_BUILD_ELECTING,
WAIT_EVENT_HASH_BUILD_HASHING_INNER,
WAIT_EVENT_HASH_BUILD_HASHING_OUTER,
WAIT_EVENT_HASH_GROW_BATCHES_ALLOCATING,
WAIT_EVENT_HASH_GROW_BATCHES_DECIDING,
WAIT_EVENT_HASH_GROW_BATCHES_ELECTING,
WAIT_EVENT_HASH_GROW_BATCHES_FINISHING,
WAIT_EVENT_HASH_GROW_BATCHES_REPARTITIONING,
WAIT_EVENT_HASH_GROW_BUCKETS_ALLOCATING,
WAIT_EVENT_HASH_GROW_BUCKETS_ELECTING,
WAIT_EVENT_HASH_GROW_BUCKETS_REINSERTING,
WAIT_EVENT_HASH_BATCH_ALLOCATE,
WAIT_EVENT_HASH_BATCH_ELECT,
WAIT_EVENT_HASH_BATCH_LOAD,
WAIT_EVENT_HASH_BUILD_ALLOCATE,
WAIT_EVENT_HASH_BUILD_ELECT,
WAIT_EVENT_HASH_BUILD_HASH_INNER,
WAIT_EVENT_HASH_BUILD_HASH_OUTER,
WAIT_EVENT_HASH_GROW_BATCHES_ALLOCATE,
WAIT_EVENT_HASH_GROW_BATCHES_DECIDE,
WAIT_EVENT_HASH_GROW_BATCHES_ELECT,
WAIT_EVENT_HASH_GROW_BATCHES_FINISH,
WAIT_EVENT_HASH_GROW_BATCHES_REPARTITION,
WAIT_EVENT_HASH_GROW_BUCKETS_ALLOCATE,
WAIT_EVENT_HASH_GROW_BUCKETS_ELECT,
WAIT_EVENT_HASH_GROW_BUCKETS_REINSERT,
WAIT_EVENT_LOGICAL_SYNC_DATA,
WAIT_EVENT_LOGICAL_SYNC_STATE_CHANGE,
WAIT_EVENT_MQ_INTERNAL,
......@@ -879,6 +878,7 @@ typedef enum
WAIT_EVENT_PARALLEL_CREATE_INDEX_SCAN,
WAIT_EVENT_PARALLEL_FINISH,
WAIT_EVENT_PROCARRAY_GROUP_UPDATE,
WAIT_EVENT_PROC_SIGNAL_BARRIER,
WAIT_EVENT_PROMOTE,
WAIT_EVENT_RECOVERY_CONFLICT_SNAPSHOT,
WAIT_EVENT_RECOVERY_CONFLICT_TABLESPACE,
......@@ -886,7 +886,8 @@ typedef enum
WAIT_EVENT_REPLICATION_ORIGIN_DROP,
WAIT_EVENT_REPLICATION_SLOT_DROP,
WAIT_EVENT_SAFE_SNAPSHOT,
WAIT_EVENT_SYNC_REP
WAIT_EVENT_SYNC_REP,
WAIT_EVENT_XACT_GROUP_UPDATE
} WaitEventIPC;
/* ----------
......@@ -943,7 +944,6 @@ typedef enum
WAIT_EVENT_LOGICAL_REWRITE_SYNC,
WAIT_EVENT_LOGICAL_REWRITE_TRUNCATE,
WAIT_EVENT_LOGICAL_REWRITE_WRITE,
WAIT_EVENT_PROC_SIGNAL_BARRIER,
WAIT_EVENT_RELATION_MAP_READ,
WAIT_EVENT_RELATION_MAP_SYNC,
WAIT_EVENT_RELATION_MAP_WRITE,
......
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