Skip to content

Commit

Permalink
Mop-up for wait event naming issues.
Browse files Browse the repository at this point in the history
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/[email protected]
  • Loading branch information
tglsfdc committed May 17, 2020
1 parent 2c8dd05 commit 3048898
Show file tree
Hide file tree
Showing 6 changed files with 142 additions and 126 deletions.
128 changes: 72 additions & 56 deletions doc/src/sgml/monitoring.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -1178,24 +1178,28 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
<entry><literal>ControlFileRead</literal></entry>
<entry>Waiting for a read from the control file.</entry>
<entry>Waiting for a read from the <filename>pg_control</filename>
file.</entry>
</row>
<row>
<entry><literal>ControlFileSync</literal></entry>
<entry>Waiting for the control file to reach stable storage.</entry>
<entry>Waiting for the <filename>pg_control</filename> file to reach
stable storage.</entry>
</row>
<row>
<entry><literal>ControlFileSyncUpdate</literal></entry>
<entry>Waiting for an update to the control file to reach stable
storage.</entry>
<entry>Waiting for an update to the <filename>pg_control</filename> file
to reach stable storage.</entry>
</row>
<row>
<entry><literal>ControlFileWrite</literal></entry>
<entry>Waiting for a write to the control file.</entry>
<entry>Waiting for a write to the <filename>pg_control</filename>
file.</entry>
</row>
<row>
<entry><literal>ControlFileWriteUpdate</literal></entry>
<entry>Waiting for a write to update the control file.</entry>
<entry>Waiting for a write to update the <filename>pg_control</filename>
file.</entry>
</row>
<row>
<entry><literal>CopyFileRead</literal></entry>
Expand All @@ -1207,8 +1211,8 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
<entry><literal>DSMFillZeroWrite</literal></entry>
<entry>Waiting to write zero bytes to a dynamic shared memory backing
file.</entry>
<entry>Waiting to fill a dynamic shared memory backing file with
zeroes.</entry>
</row>
<row>
<entry><literal>DataFileExtend</literal></entry>
Expand Down Expand Up @@ -1308,11 +1312,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
<entry><literal>LogicalRewriteWrite</literal></entry>
<entry>Waiting for a write of logical rewrite mappings.</entry>
</row>
<row>
<entry><literal>ProcSignalBarrier</literal></entry>
<entry>Waiting for a barrier event to be processed by all
backends.</entry>
</row>
<row>
<entry><literal>RelationMapRead</literal></entry>
<entry>Waiting for a read of the relation map file.</entry>
Expand Down Expand Up @@ -1464,7 +1463,7 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
<entry><literal>WALSenderTimelineHistoryRead</literal></entry>
<entry>Waiting for a read from a timeline history file during walsender
<entry>Waiting for a read from a timeline history file during a walsender
timeline command.</entry>
</row>
<row>
Expand All @@ -1473,8 +1472,8 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
<entry><literal>WALSyncMethodAssign</literal></entry>
<entry>Waiting for data to reach stable storage while assigning WAL sync
method.</entry>
<entry>Waiting for data to reach stable storage while assigning a new
WAL sync method.</entry>
</row>
<row>
<entry><literal>WALWrite</literal></entry>
Expand All @@ -1497,7 +1496,7 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
<tbody>
<row>
<entry><literal>BackupWaitWalArchive</literal></entry>
<entry>Waiting for WAL files required for the backup to be successfully
<entry>Waiting for WAL files required for a backup to be successfully
archived.</entry>
</row>
<row>
Expand All @@ -1521,98 +1520,100 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
<entry><literal>CheckpointStart</literal></entry>
<entry>Waiting for a checkpoint to start.</entry>
</row>
<row>
<entry><literal>ClogGroupUpdate</literal></entry>
<entry>Waiting for group leader to update transaction status at
transaction end.</entry>
</row>
<row>
<entry><literal>ExecuteGather</literal></entry>
<entry>Waiting for activity from child process while
executing <literal>Gather</literal> node.</entry>
<entry>Waiting for activity from a child process while
executing a <literal>Gather</literal> plan node.</entry>
</row>
<row>
<entry><literal>Hash/Batch/Allocating</literal></entry>
<entry><literal>HashBatchAllocate</literal></entry>
<entry>Waiting for an elected Parallel Hash participant to allocate a hash
table.</entry>
</row>
<row>
<entry><literal>Hash/Batch/Electing</literal></entry>
<entry>Electing a Parallel Hash participant to allocate a hash table.</entry>
<entry><literal>HashBatchElect</literal></entry>
<entry>Waiting to elect a Parallel Hash participant to allocate a hash
table.</entry>
</row>
<row>
<entry><literal>Hash/Batch/Loading</literal></entry>
<entry><literal>HashBatchLoad</literal></entry>
<entry>Waiting for other Parallel Hash participants to finish loading a
hash table.</entry>
</row>
<row>
<entry><literal>Hash/Build/Allocating</literal></entry>
<entry><literal>HashBuildAllocate</literal></entry>
<entry>Waiting for an elected Parallel Hash participant to allocate the
initial hash table.</entry>
</row>
<row>
<entry><literal>Hash/Build/Electing</literal></entry>
<entry>Electing a Parallel Hash participant to allocate the initial hash table.</entry>
<entry><literal>HashBuildElect</literal></entry>
<entry>Waiting to elect a Parallel Hash participant to allocate the
initial hash table.</entry>
</row>
<row>
<entry><literal>Hash/Build/HashingInner</literal></entry>
<entry><literal>HashBuildHashInner</literal></entry>
<entry>Waiting for other Parallel Hash participants to finish hashing the
inner relation.</entry>
</row>
<row>
<entry><literal>Hash/Build/HashingOuter</literal></entry>
<entry><literal>HashBuildHashOuter</literal></entry>
<entry>Waiting for other Parallel Hash participants to finish partitioning
the outer relation.</entry>
</row>
<row>
<entry><literal>Hash/GrowBatches/Allocating</literal></entry>
<entry><literal>HashGrowBatchesAllocate</literal></entry>
<entry>Waiting for an elected Parallel Hash participant to allocate more
batches.</entry>
</row>
<row>
<entry><literal>Hash/GrowBatches/Deciding</literal></entry>
<entry>Electing a Parallel Hash participant to decide on future batch growth.</entry>
<entry><literal>HashGrowBatchesDecide</literal></entry>
<entry>Waiting to elect a Parallel Hash participant to decide on future
batch growth.</entry>
</row>
<row>
<entry><literal>Hash/GrowBatches/Electing</literal></entry>
<entry>Electing a Parallel Hash participant to allocate more batches.</entry>
<entry><literal>HashGrowBatchesElect</literal></entry>
<entry>Waiting to elect a Parallel Hash participant to allocate more
batches.</entry>
</row>
<row>
<entry><literal>Hash/GrowBatches/Finishing</literal></entry>
<entry><literal>HashGrowBatchesFinish</literal></entry>
<entry>Waiting for an elected Parallel Hash participant to decide on
future batch growth.</entry>
</row>
<row>
<entry><literal>Hash/GrowBatches/Repartitioning</literal></entry>
<entry>Waiting for other Parallel Hash participants to finishing
<entry><literal>HashGrowBatchesRepartition</literal></entry>
<entry>Waiting for other Parallel Hash participants to finish
repartitioning.</entry>
</row>
<row>
<entry><literal>Hash/GrowBuckets/Allocating</literal></entry>
<entry><literal>HashGrowBucketsAllocate</literal></entry>
<entry>Waiting for an elected Parallel Hash participant to finish
allocating more buckets.</entry>
</row>
<row>
<entry><literal>Hash/GrowBuckets/Electing</literal></entry>
<entry>Electing a Parallel Hash participant to allocate more buckets.</entry>
<entry><literal>HashGrowBucketsElect</literal></entry>
<entry>Waiting to elect a Parallel Hash participant to allocate more
buckets.</entry>
</row>
<row>
<entry><literal>Hash/GrowBuckets/Reinserting</literal></entry>
<entry><literal>HashGrowBucketsReinsert</literal></entry>
<entry>Waiting for other Parallel Hash participants to finish inserting
tuples into new buckets.</entry>
</row>
<row>
<entry><literal>LogicalSyncData</literal></entry>
<entry>Waiting for logical replication remote server to send data for
<entry>Waiting for a logical replication remote server to send data for
initial table synchronization.</entry>
</row>
<row>
<entry><literal>LogicalSyncStateChange</literal></entry>
<entry>Waiting for logical replication remote server to change state.</entry>
<entry>Waiting for a logical replication remote server to change
state.</entry>
</row>
<row>
<entry><literal>MessageQueueInternal</literal></entry>
<entry>Waiting for other process to be attached in shared message queue.</entry>
<entry>Waiting for another process to be attached to a shared message
queue.</entry>
</row>
<row>
<entry><literal>MessageQueuePutMessage</literal></entry>
Expand Down Expand Up @@ -1641,42 +1642,57 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
</row>
<row>
<entry><literal>ProcArrayGroupUpdate</literal></entry>
<entry>Waiting for group leader to clear transaction id at transaction end.</entry>
<entry>Waiting for the group leader to clear the transaction ID at
end of a parallel operation.</entry>
</row>
<row>
<entry><literal>ProcSignalBarrier</literal></entry>
<entry>Waiting for a barrier event to be processed by all
backends.</entry>
</row>
<row>
<entry><literal>Promote</literal></entry>
<entry>Waiting for standby promotion.</entry>
</row>
<row>
<entry><literal>RecoveryConflictSnapshot</literal></entry>
<entry>Waiting for recovery conflict resolution on a vacuum cleanup.</entry>
<entry>Waiting for recovery conflict resolution for a vacuum
cleanup.</entry>
</row>
<row>
<entry><literal>RecoveryConflictTablespace</literal></entry>
<entry>Waiting for recovery conflict resolution on dropping tablespace.</entry>
<entry>Waiting for recovery conflict resolution for dropping a
tablespace.</entry>
</row>
<row>
<entry><literal>RecoveryPause</literal></entry>
<entry>Waiting for recovery to be resumed.</entry>
</row>
<row>
<entry><literal>ReplicationOriginDrop</literal></entry>
<entry>Waiting for a replication origin to become inactive to be dropped.</entry>
<entry>Waiting for a replication origin to become inactive so it can be
dropped.</entry>
</row>
<row>
<entry><literal>ReplicationSlotDrop</literal></entry>
<entry>Waiting for a replication slot to become inactive to be dropped.</entry>
<entry>Waiting for a replication slot to become inactive so it can be
dropped.</entry>
</row>
<row>
<entry><literal>SafeSnapshot</literal></entry>
<entry>Waiting for a snapshot for a <literal>READ ONLY DEFERRABLE</literal>
transaction.</entry>
<entry>Waiting to obtain a valid snapshot for a <literal>READ ONLY
DEFERRABLE</literal> transaction.</entry>
</row>
<row>
<entry><literal>SyncRep</literal></entry>
<entry>Waiting for confirmation from remote server during synchronous
<entry>Waiting for confirmation from a remote server during synchronous
replication.</entry>
</row>
<row>
<entry><literal>XactGroupUpdate</literal></entry>
<entry>Waiting for the group leader to update transaction status at
end of a parallel operation.</entry>
</row>
</tbody>
</tgroup>
</table>
Expand Down
2 changes: 1 addition & 1 deletion src/backend/access/transam/clog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
22 changes: 11 additions & 11 deletions src/backend/executor/nodeHash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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);
}
}

Expand Down
Loading

0 comments on commit 3048898

Please sign in to comment.