@@ -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 isn't
346
+ * case, which will bring the build phase to PHJ_BUILD_RUN (if it isn't
347
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
/* ----------------------------------------------------------------
@@ -596,8 +596,8 @@ ExecHashTableCreate(HashState *state, List *hashOperators, List *hashCollations,
596
596
* Attach to the build barrier. The corresponding detach operation is
597
597
* in ExecHashTableDetach. Note that we won't attach to the
598
598
* batch_barrier for batch 0 yet. We'll attach later and start it out
599
- * in PHJ_BATCH_PROBING phase, because batch 0 is allocated up front
600
- * and then loaded while hashing (the standard hybrid hash join
599
+ * in PHJ_BATCH_PROBE phase, because batch 0 is allocated up front and
600
+ * then loaded while hashing (the standard hybrid hash join
601
601
* algorithm), and we'll coordinate that using build_barrier.
602
602
*/
603
603
build_barrier = & pstate -> build_barrier ;
@@ -610,7 +610,7 @@ ExecHashTableCreate(HashState *state, List *hashOperators, List *hashCollations,
610
610
* SharedHashJoinBatch objects and the hash table for batch 0. One
611
611
* backend will be elected to do that now if necessary.
612
612
*/
613
- if (BarrierPhase (build_barrier ) == PHJ_BUILD_ELECTING &&
613
+ if (BarrierPhase (build_barrier ) == PHJ_BUILD_ELECT &&
614
614
BarrierArriveAndWait (build_barrier , WAIT_EVENT_HASH_BUILD_ELECT ))
615
615
{
616
616
pstate -> nbatch = nbatch ;
@@ -631,7 +631,7 @@ ExecHashTableCreate(HashState *state, List *hashOperators, List *hashCollations,
631
631
/*
632
632
* The next Parallel Hash synchronization point is in
633
633
* MultiExecParallelHash(), which will progress it all the way to
634
- * PHJ_BUILD_RUNNING . The caller must not return control from this
634
+ * PHJ_BUILD_RUN . The caller must not return control from this
635
635
* executor node between now and then.
636
636
*/
637
637
}
@@ -1067,7 +1067,7 @@ ExecParallelHashIncreaseNumBatches(HashJoinTable hashtable)
1067
1067
ParallelHashJoinState * pstate = hashtable -> parallel_state ;
1068
1068
int i ;
1069
1069
1070
- Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_HASHING_INNER );
1070
+ Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_HASH_INNER );
1071
1071
1072
1072
/*
1073
1073
* It's unlikely, but we need to be prepared for new participants to show
@@ -1076,7 +1076,7 @@ ExecParallelHashIncreaseNumBatches(HashJoinTable hashtable)
1076
1076
*/
1077
1077
switch (PHJ_GROW_BATCHES_PHASE (BarrierPhase (& pstate -> grow_batches_barrier )))
1078
1078
{
1079
- case PHJ_GROW_BATCHES_ELECTING :
1079
+ case PHJ_GROW_BATCHES_ELECT :
1080
1080
1081
1081
/*
1082
1082
* Elect one participant to prepare to grow the number of batches.
@@ -1194,13 +1194,13 @@ ExecParallelHashIncreaseNumBatches(HashJoinTable hashtable)
1194
1194
}
1195
1195
/* Fall through. */
1196
1196
1197
- case PHJ_GROW_BATCHES_ALLOCATING :
1197
+ case PHJ_GROW_BATCHES_REALLOCATE :
1198
1198
/* Wait for the above to be finished. */
1199
1199
BarrierArriveAndWait (& pstate -> grow_batches_barrier ,
1200
- WAIT_EVENT_HASH_GROW_BATCHES_ALLOCATE );
1200
+ WAIT_EVENT_HASH_GROW_BATCHES_REALLOCATE );
1201
1201
/* Fall through. */
1202
1202
1203
- case PHJ_GROW_BATCHES_REPARTITIONING :
1203
+ case PHJ_GROW_BATCHES_REPARTITION :
1204
1204
/* Make sure that we have the current dimensions and buckets. */
1205
1205
ExecParallelHashEnsureBatchAccessors (hashtable );
1206
1206
ExecParallelHashTableSetCurrentBatch (hashtable , 0 );
@@ -1213,7 +1213,7 @@ ExecParallelHashIncreaseNumBatches(HashJoinTable hashtable)
1213
1213
WAIT_EVENT_HASH_GROW_BATCHES_REPARTITION );
1214
1214
/* Fall through. */
1215
1215
1216
- case PHJ_GROW_BATCHES_DECIDING :
1216
+ case PHJ_GROW_BATCHES_DECIDE :
1217
1217
1218
1218
/*
1219
1219
* Elect one participant to clean up and decide whether further
@@ -1268,7 +1268,7 @@ ExecParallelHashIncreaseNumBatches(HashJoinTable hashtable)
1268
1268
}
1269
1269
/* Fall through. */
1270
1270
1271
- case PHJ_GROW_BATCHES_FINISHING :
1271
+ case PHJ_GROW_BATCHES_FINISH :
1272
1272
/* Wait for the above to complete. */
1273
1273
BarrierArriveAndWait (& pstate -> grow_batches_barrier ,
1274
1274
WAIT_EVENT_HASH_GROW_BATCHES_FINISH );
@@ -1508,7 +1508,7 @@ ExecParallelHashIncreaseNumBuckets(HashJoinTable hashtable)
1508
1508
HashMemoryChunk chunk ;
1509
1509
dsa_pointer chunk_s ;
1510
1510
1511
- Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_HASHING_INNER );
1511
+ Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_HASH_INNER );
1512
1512
1513
1513
/*
1514
1514
* It's unlikely, but we need to be prepared for new participants to show
@@ -1517,7 +1517,7 @@ ExecParallelHashIncreaseNumBuckets(HashJoinTable hashtable)
1517
1517
*/
1518
1518
switch (PHJ_GROW_BUCKETS_PHASE (BarrierPhase (& pstate -> grow_buckets_barrier )))
1519
1519
{
1520
- case PHJ_GROW_BUCKETS_ELECTING :
1520
+ case PHJ_GROW_BUCKETS_ELECT :
1521
1521
/* Elect one participant to prepare to increase nbuckets. */
1522
1522
if (BarrierArriveAndWait (& pstate -> grow_buckets_barrier ,
1523
1523
WAIT_EVENT_HASH_GROW_BUCKETS_ELECT ))
@@ -1546,13 +1546,13 @@ ExecParallelHashIncreaseNumBuckets(HashJoinTable hashtable)
1546
1546
}
1547
1547
/* Fall through. */
1548
1548
1549
- case PHJ_GROW_BUCKETS_ALLOCATING :
1549
+ case PHJ_GROW_BUCKETS_REALLOCATE :
1550
1550
/* Wait for the above to complete. */
1551
1551
BarrierArriveAndWait (& pstate -> grow_buckets_barrier ,
1552
- WAIT_EVENT_HASH_GROW_BUCKETS_ALLOCATE );
1552
+ WAIT_EVENT_HASH_GROW_BUCKETS_REALLOCATE );
1553
1553
/* Fall through. */
1554
1554
1555
- case PHJ_GROW_BUCKETS_REINSERTING :
1555
+ case PHJ_GROW_BUCKETS_REINSERT :
1556
1556
/* Reinsert all tuples into the hash table. */
1557
1557
ExecParallelHashEnsureBatchAccessors (hashtable );
1558
1558
ExecParallelHashTableSetCurrentBatch (hashtable , 0 );
@@ -1708,7 +1708,7 @@ ExecParallelHashTableInsert(HashJoinTable hashtable,
1708
1708
1709
1709
/* Try to load it into memory. */
1710
1710
Assert (BarrierPhase (& hashtable -> parallel_state -> build_barrier ) ==
1711
- PHJ_BUILD_HASHING_INNER );
1711
+ PHJ_BUILD_HASH_INNER );
1712
1712
hashTuple = ExecParallelHashTupleAlloc (hashtable ,
1713
1713
HJTUPLE_OVERHEAD + tuple -> t_len ,
1714
1714
& shared );
@@ -2862,7 +2862,7 @@ ExecParallelHashTupleAlloc(HashJoinTable hashtable, size_t size,
2862
2862
if (pstate -> growth != PHJ_GROWTH_DISABLED )
2863
2863
{
2864
2864
Assert (curbatch == 0 );
2865
- Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_HASHING_INNER );
2865
+ Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_HASH_INNER );
2866
2866
2867
2867
/*
2868
2868
* Check if our space limit would be exceeded. To avoid choking on
@@ -2982,7 +2982,7 @@ ExecParallelHashJoinSetUpBatches(HashJoinTable hashtable, int nbatch)
2982
2982
{
2983
2983
/* Batch 0 doesn't need to be loaded. */
2984
2984
BarrierAttach (& shared -> batch_barrier );
2985
- while (BarrierPhase (& shared -> batch_barrier ) < PHJ_BATCH_PROBING )
2985
+ while (BarrierPhase (& shared -> batch_barrier ) < PHJ_BATCH_PROBE )
2986
2986
BarrierArriveAndWait (& shared -> batch_barrier , 0 );
2987
2987
BarrierDetach (& shared -> batch_barrier );
2988
2988
}
@@ -3056,8 +3056,8 @@ ExecParallelHashEnsureBatchAccessors(HashJoinTable hashtable)
3056
3056
3057
3057
/*
3058
3058
* We should never see a state where the batch-tracking array is freed,
3059
- * because we should have given up sooner if we join when the build barrier
3060
- * has reached the PHJ_BUILD_DONE phase.
3059
+ * because we should have given up sooner if we join when the build
3060
+ * barrier has reached the PHJ_BUILD_FREE phase.
3061
3061
*/
3062
3062
Assert (DsaPointerIsValid (pstate -> batches ));
3063
3063
@@ -3140,7 +3140,7 @@ ExecHashTableDetachBatch(HashJoinTable hashtable)
3140
3140
* longer attached, but since there is no way it's moving after
3141
3141
* this point it seems safe to make the following assertion.
3142
3142
*/
3143
- Assert (BarrierPhase (& batch -> batch_barrier ) == PHJ_BATCH_DONE );
3143
+ Assert (BarrierPhase (& batch -> batch_barrier ) == PHJ_BATCH_FREE );
3144
3144
3145
3145
/* Free shared chunks and buckets. */
3146
3146
while (DsaPointerIsValid (batch -> chunks ))
@@ -3183,12 +3183,12 @@ ExecHashTableDetach(HashJoinTable hashtable)
3183
3183
3184
3184
/*
3185
3185
* If we're involved in a parallel query, we must either have got all the
3186
- * way to PHJ_BUILD_RUNNING , or joined too late and be in PHJ_BUILD_DONE .
3186
+ * way to PHJ_BUILD_RUN , or joined too late and be in PHJ_BUILD_FREE .
3187
3187
*/
3188
3188
Assert (!pstate ||
3189
- BarrierPhase (& pstate -> build_barrier ) >= PHJ_BUILD_RUNNING );
3189
+ BarrierPhase (& pstate -> build_barrier ) >= PHJ_BUILD_RUN );
3190
3190
3191
- if (pstate && BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_RUNNING )
3191
+ if (pstate && BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_RUN )
3192
3192
{
3193
3193
int i ;
3194
3194
@@ -3211,7 +3211,7 @@ ExecHashTableDetach(HashJoinTable hashtable)
3211
3211
* Late joining processes will see this state and give up
3212
3212
* immediately.
3213
3213
*/
3214
- Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_DONE );
3214
+ Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_FREE );
3215
3215
3216
3216
if (DsaPointerIsValid (pstate -> batches ))
3217
3217
{
0 commit comments