@@ -246,10 +246,10 @@ MultiExecParallelHash(HashState *node)
246
246
*/
247
247
pstate = hashtable -> parallel_state ;
248
248
build_barrier = & pstate -> build_barrier ;
249
- Assert (BarrierPhase (build_barrier ) >= PHJ_BUILD_ALLOCATING );
249
+ Assert (BarrierPhase (build_barrier ) >= PHJ_BUILD_ALLOCATE );
250
250
switch (BarrierPhase (build_barrier ))
251
251
{
252
- case PHJ_BUILD_ALLOCATING :
252
+ case PHJ_BUILD_ALLOCATE :
253
253
254
254
/*
255
255
* Either I just allocated the initial hash table in
@@ -259,7 +259,7 @@ MultiExecParallelHash(HashState *node)
259
259
BarrierArriveAndWait (build_barrier , WAIT_EVENT_HASH_BUILD_ALLOCATE );
260
260
/* Fall through. */
261
261
262
- case PHJ_BUILD_HASHING_INNER :
262
+ case PHJ_BUILD_HASH_INNER :
263
263
264
264
/*
265
265
* It's time to begin hashing, or if we just arrived here then
@@ -271,10 +271,10 @@ MultiExecParallelHash(HashState *node)
271
271
* below.
272
272
*/
273
273
if (PHJ_GROW_BATCHES_PHASE (BarrierAttach (& pstate -> grow_batches_barrier )) !=
274
- PHJ_GROW_BATCHES_ELECTING )
274
+ PHJ_GROW_BATCHES_ELECT )
275
275
ExecParallelHashIncreaseNumBatches (hashtable );
276
276
if (PHJ_GROW_BUCKETS_PHASE (BarrierAttach (& pstate -> grow_buckets_barrier )) !=
277
- PHJ_GROW_BUCKETS_ELECTING )
277
+ PHJ_GROW_BUCKETS_ELECT )
278
278
ExecParallelHashIncreaseNumBuckets (hashtable );
279
279
ExecParallelHashEnsureBatchAccessors (hashtable );
280
280
ExecParallelHashTableSetCurrentBatch (hashtable , 0 );
@@ -338,17 +338,17 @@ MultiExecParallelHash(HashState *node)
338
338
* Unless we're completely done and the batch state has been freed, make
339
339
* sure we have accessors.
340
340
*/
341
- if (BarrierPhase (build_barrier ) < PHJ_BUILD_DONE )
341
+ if (BarrierPhase (build_barrier ) < PHJ_BUILD_FREE )
342
342
ExecParallelHashEnsureBatchAccessors (hashtable );
343
343
344
344
/*
345
345
* The next synchronization point is in ExecHashJoin's HJ_BUILD_HASHTABLE
346
- * case, which will bring the build phase to PHJ_BUILD_RUNNING (if it
347
- * isn't there already).
346
+ * case, which will bring the build phase to PHJ_BUILD_RUN (if it isn't
347
+ * there already).
348
348
*/
349
- Assert (BarrierPhase (build_barrier ) == PHJ_BUILD_HASHING_OUTER ||
350
- BarrierPhase (build_barrier ) == PHJ_BUILD_RUNNING ||
351
- BarrierPhase (build_barrier ) == PHJ_BUILD_DONE );
349
+ Assert (BarrierPhase (build_barrier ) == PHJ_BUILD_HASH_OUTER ||
350
+ BarrierPhase (build_barrier ) == PHJ_BUILD_RUN ||
351
+ BarrierPhase (build_barrier ) == PHJ_BUILD_FREE );
352
352
}
353
353
354
354
/* ----------------------------------------------------------------
@@ -592,8 +592,8 @@ ExecHashTableCreate(HashState *state, List *hashOperators, List *hashCollations,
592
592
* Attach to the build barrier. The corresponding detach operation is
593
593
* in ExecHashTableDetach. Note that we won't attach to the
594
594
* batch_barrier for batch 0 yet. We'll attach later and start it out
595
- * in PHJ_BATCH_PROBING phase, because batch 0 is allocated up front
596
- * and then loaded while hashing (the standard hybrid hash join
595
+ * in PHJ_BATCH_PROBE phase, because batch 0 is allocated up front and
596
+ * then loaded while hashing (the standard hybrid hash join
597
597
* algorithm), and we'll coordinate that using build_barrier.
598
598
*/
599
599
build_barrier = & pstate -> build_barrier ;
@@ -606,7 +606,7 @@ ExecHashTableCreate(HashState *state, List *hashOperators, List *hashCollations,
606
606
* SharedHashJoinBatch objects and the hash table for batch 0. One
607
607
* backend will be elected to do that now if necessary.
608
608
*/
609
- if (BarrierPhase (build_barrier ) == PHJ_BUILD_ELECTING &&
609
+ if (BarrierPhase (build_barrier ) == PHJ_BUILD_ELECT &&
610
610
BarrierArriveAndWait (build_barrier , WAIT_EVENT_HASH_BUILD_ELECT ))
611
611
{
612
612
pstate -> nbatch = nbatch ;
@@ -627,7 +627,7 @@ ExecHashTableCreate(HashState *state, List *hashOperators, List *hashCollations,
627
627
/*
628
628
* The next Parallel Hash synchronization point is in
629
629
* MultiExecParallelHash(), which will progress it all the way to
630
- * PHJ_BUILD_RUNNING . The caller must not return control from this
630
+ * PHJ_BUILD_RUN . The caller must not return control from this
631
631
* executor node between now and then.
632
632
*/
633
633
}
@@ -1075,7 +1075,7 @@ ExecParallelHashIncreaseNumBatches(HashJoinTable hashtable)
1075
1075
{
1076
1076
ParallelHashJoinState * pstate = hashtable -> parallel_state ;
1077
1077
1078
- Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_HASHING_INNER );
1078
+ Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_HASH_INNER );
1079
1079
1080
1080
/*
1081
1081
* It's unlikely, but we need to be prepared for new participants to show
@@ -1084,7 +1084,7 @@ ExecParallelHashIncreaseNumBatches(HashJoinTable hashtable)
1084
1084
*/
1085
1085
switch (PHJ_GROW_BATCHES_PHASE (BarrierPhase (& pstate -> grow_batches_barrier )))
1086
1086
{
1087
- case PHJ_GROW_BATCHES_ELECTING :
1087
+ case PHJ_GROW_BATCHES_ELECT :
1088
1088
1089
1089
/*
1090
1090
* Elect one participant to prepare to grow the number of batches.
@@ -1200,13 +1200,13 @@ ExecParallelHashIncreaseNumBatches(HashJoinTable hashtable)
1200
1200
}
1201
1201
/* Fall through. */
1202
1202
1203
- case PHJ_GROW_BATCHES_ALLOCATING :
1203
+ case PHJ_GROW_BATCHES_REALLOCATE :
1204
1204
/* Wait for the above to be finished. */
1205
1205
BarrierArriveAndWait (& pstate -> grow_batches_barrier ,
1206
- WAIT_EVENT_HASH_GROW_BATCHES_ALLOCATE );
1206
+ WAIT_EVENT_HASH_GROW_BATCHES_REALLOCATE );
1207
1207
/* Fall through. */
1208
1208
1209
- case PHJ_GROW_BATCHES_REPARTITIONING :
1209
+ case PHJ_GROW_BATCHES_REPARTITION :
1210
1210
/* Make sure that we have the current dimensions and buckets. */
1211
1211
ExecParallelHashEnsureBatchAccessors (hashtable );
1212
1212
ExecParallelHashTableSetCurrentBatch (hashtable , 0 );
@@ -1219,7 +1219,7 @@ ExecParallelHashIncreaseNumBatches(HashJoinTable hashtable)
1219
1219
WAIT_EVENT_HASH_GROW_BATCHES_REPARTITION );
1220
1220
/* Fall through. */
1221
1221
1222
- case PHJ_GROW_BATCHES_DECIDING :
1222
+ case PHJ_GROW_BATCHES_DECIDE :
1223
1223
1224
1224
/*
1225
1225
* Elect one participant to clean up and decide whether further
@@ -1274,7 +1274,7 @@ ExecParallelHashIncreaseNumBatches(HashJoinTable hashtable)
1274
1274
}
1275
1275
/* Fall through. */
1276
1276
1277
- case PHJ_GROW_BATCHES_FINISHING :
1277
+ case PHJ_GROW_BATCHES_FINISH :
1278
1278
/* Wait for the above to complete. */
1279
1279
BarrierArriveAndWait (& pstate -> grow_batches_barrier ,
1280
1280
WAIT_EVENT_HASH_GROW_BATCHES_FINISH );
@@ -1514,7 +1514,7 @@ ExecParallelHashIncreaseNumBuckets(HashJoinTable hashtable)
1514
1514
HashMemoryChunk chunk ;
1515
1515
dsa_pointer chunk_s ;
1516
1516
1517
- Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_HASHING_INNER );
1517
+ Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_HASH_INNER );
1518
1518
1519
1519
/*
1520
1520
* It's unlikely, but we need to be prepared for new participants to show
@@ -1523,7 +1523,7 @@ ExecParallelHashIncreaseNumBuckets(HashJoinTable hashtable)
1523
1523
*/
1524
1524
switch (PHJ_GROW_BUCKETS_PHASE (BarrierPhase (& pstate -> grow_buckets_barrier )))
1525
1525
{
1526
- case PHJ_GROW_BUCKETS_ELECTING :
1526
+ case PHJ_GROW_BUCKETS_ELECT :
1527
1527
/* Elect one participant to prepare to increase nbuckets. */
1528
1528
if (BarrierArriveAndWait (& pstate -> grow_buckets_barrier ,
1529
1529
WAIT_EVENT_HASH_GROW_BUCKETS_ELECT ))
@@ -1552,13 +1552,13 @@ ExecParallelHashIncreaseNumBuckets(HashJoinTable hashtable)
1552
1552
}
1553
1553
/* Fall through. */
1554
1554
1555
- case PHJ_GROW_BUCKETS_ALLOCATING :
1555
+ case PHJ_GROW_BUCKETS_REALLOCATE :
1556
1556
/* Wait for the above to complete. */
1557
1557
BarrierArriveAndWait (& pstate -> grow_buckets_barrier ,
1558
- WAIT_EVENT_HASH_GROW_BUCKETS_ALLOCATE );
1558
+ WAIT_EVENT_HASH_GROW_BUCKETS_REALLOCATE );
1559
1559
/* Fall through. */
1560
1560
1561
- case PHJ_GROW_BUCKETS_REINSERTING :
1561
+ case PHJ_GROW_BUCKETS_REINSERT :
1562
1562
/* Reinsert all tuples into the hash table. */
1563
1563
ExecParallelHashEnsureBatchAccessors (hashtable );
1564
1564
ExecParallelHashTableSetCurrentBatch (hashtable , 0 );
@@ -1714,7 +1714,7 @@ ExecParallelHashTableInsert(HashJoinTable hashtable,
1714
1714
1715
1715
/* Try to load it into memory. */
1716
1716
Assert (BarrierPhase (& hashtable -> parallel_state -> build_barrier ) ==
1717
- PHJ_BUILD_HASHING_INNER );
1717
+ PHJ_BUILD_HASH_INNER );
1718
1718
hashTuple = ExecParallelHashTupleAlloc (hashtable ,
1719
1719
HJTUPLE_OVERHEAD + tuple -> t_len ,
1720
1720
& shared );
@@ -2868,7 +2868,7 @@ ExecParallelHashTupleAlloc(HashJoinTable hashtable, size_t size,
2868
2868
if (pstate -> growth != PHJ_GROWTH_DISABLED )
2869
2869
{
2870
2870
Assert (curbatch == 0 );
2871
- Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_HASHING_INNER );
2871
+ Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_HASH_INNER );
2872
2872
2873
2873
/*
2874
2874
* Check if our space limit would be exceeded. To avoid choking on
@@ -2988,7 +2988,7 @@ ExecParallelHashJoinSetUpBatches(HashJoinTable hashtable, int nbatch)
2988
2988
{
2989
2989
/* Batch 0 doesn't need to be loaded. */
2990
2990
BarrierAttach (& shared -> batch_barrier );
2991
- while (BarrierPhase (& shared -> batch_barrier ) < PHJ_BATCH_PROBING )
2991
+ while (BarrierPhase (& shared -> batch_barrier ) < PHJ_BATCH_PROBE )
2992
2992
BarrierArriveAndWait (& shared -> batch_barrier , 0 );
2993
2993
BarrierDetach (& shared -> batch_barrier );
2994
2994
}
@@ -3063,7 +3063,7 @@ ExecParallelHashEnsureBatchAccessors(HashJoinTable hashtable)
3063
3063
/*
3064
3064
* We should never see a state where the batch-tracking array is freed,
3065
3065
* because we should have given up sooner if we join when the build
3066
- * barrier has reached the PHJ_BUILD_DONE phase.
3066
+ * barrier has reached the PHJ_BUILD_FREE phase.
3067
3067
*/
3068
3068
Assert (DsaPointerIsValid (pstate -> batches ));
3069
3069
@@ -3146,7 +3146,7 @@ ExecHashTableDetachBatch(HashJoinTable hashtable)
3146
3146
* longer attached, but since there is no way it's moving after
3147
3147
* this point it seems safe to make the following assertion.
3148
3148
*/
3149
- Assert (BarrierPhase (& batch -> batch_barrier ) == PHJ_BATCH_DONE );
3149
+ Assert (BarrierPhase (& batch -> batch_barrier ) == PHJ_BATCH_FREE );
3150
3150
3151
3151
/* Free shared chunks and buckets. */
3152
3152
while (DsaPointerIsValid (batch -> chunks ))
@@ -3189,13 +3189,12 @@ ExecHashTableDetach(HashJoinTable hashtable)
3189
3189
3190
3190
/*
3191
3191
* If we're involved in a parallel query, we must either have gotten all
3192
- * the way to PHJ_BUILD_RUNNING, or joined too late and be in
3193
- * PHJ_BUILD_DONE.
3192
+ * the way to PHJ_BUILD_RUN, or joined too late and be in PHJ_BUILD_FREE.
3194
3193
*/
3195
3194
Assert (!pstate ||
3196
- BarrierPhase (& pstate -> build_barrier ) >= PHJ_BUILD_RUNNING );
3195
+ BarrierPhase (& pstate -> build_barrier ) >= PHJ_BUILD_RUN );
3197
3196
3198
- if (pstate && BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_RUNNING )
3197
+ if (pstate && BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_RUN )
3199
3198
{
3200
3199
int i ;
3201
3200
@@ -3218,7 +3217,7 @@ ExecHashTableDetach(HashJoinTable hashtable)
3218
3217
* Late joining processes will see this state and give up
3219
3218
* immediately.
3220
3219
*/
3221
- Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_DONE );
3220
+ Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_FREE );
3222
3221
3223
3222
if (DsaPointerIsValid (pstate -> batches ))
3224
3223
{
0 commit comments