@@ -246,10 +246,10 @@ MultiExecParallelHash(HashState *node)
246246 */
247247 pstate = hashtable -> parallel_state ;
248248 build_barrier = & pstate -> build_barrier ;
249- Assert (BarrierPhase (build_barrier ) >= PHJ_BUILD_ALLOCATING );
249+ Assert (BarrierPhase (build_barrier ) >= PHJ_BUILD_ALLOCATE );
250250 switch (BarrierPhase (build_barrier ))
251251 {
252- case PHJ_BUILD_ALLOCATING :
252+ case PHJ_BUILD_ALLOCATE :
253253
254254 /*
255255 * Either I just allocated the initial hash table in
@@ -259,7 +259,7 @@ MultiExecParallelHash(HashState *node)
259259 BarrierArriveAndWait (build_barrier , WAIT_EVENT_HASH_BUILD_ALLOCATE );
260260 /* Fall through. */
261261
262- case PHJ_BUILD_HASHING_INNER :
262+ case PHJ_BUILD_HASH_INNER :
263263
264264 /*
265265 * It's time to begin hashing, or if we just arrived here then
@@ -271,10 +271,10 @@ MultiExecParallelHash(HashState *node)
271271 * below.
272272 */
273273 if (PHJ_GROW_BATCHES_PHASE (BarrierAttach (& pstate -> grow_batches_barrier )) !=
274- PHJ_GROW_BATCHES_ELECTING )
274+ PHJ_GROW_BATCHES_ELECT )
275275 ExecParallelHashIncreaseNumBatches (hashtable );
276276 if (PHJ_GROW_BUCKETS_PHASE (BarrierAttach (& pstate -> grow_buckets_barrier )) !=
277- PHJ_GROW_BUCKETS_ELECTING )
277+ PHJ_GROW_BUCKETS_ELECT )
278278 ExecParallelHashIncreaseNumBuckets (hashtable );
279279 ExecParallelHashEnsureBatchAccessors (hashtable );
280280 ExecParallelHashTableSetCurrentBatch (hashtable , 0 );
@@ -338,17 +338,17 @@ MultiExecParallelHash(HashState *node)
338338 * Unless we're completely done and the batch state has been freed, make
339339 * sure we have accessors.
340340 */
341- if (BarrierPhase (build_barrier ) < PHJ_BUILD_DONE )
341+ if (BarrierPhase (build_barrier ) < PHJ_BUILD_FREE )
342342 ExecParallelHashEnsureBatchAccessors (hashtable );
343343
344344 /*
345345 * 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).
348348 */
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 );
352352}
353353
354354/* ----------------------------------------------------------------
@@ -592,8 +592,8 @@ ExecHashTableCreate(HashState *state, List *hashOperators, List *hashCollations,
592592 * Attach to the build barrier. The corresponding detach operation is
593593 * in ExecHashTableDetach. Note that we won't attach to the
594594 * 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
597597 * algorithm), and we'll coordinate that using build_barrier.
598598 */
599599 build_barrier = & pstate -> build_barrier ;
@@ -606,7 +606,7 @@ ExecHashTableCreate(HashState *state, List *hashOperators, List *hashCollations,
606606 * SharedHashJoinBatch objects and the hash table for batch 0. One
607607 * backend will be elected to do that now if necessary.
608608 */
609- if (BarrierPhase (build_barrier ) == PHJ_BUILD_ELECTING &&
609+ if (BarrierPhase (build_barrier ) == PHJ_BUILD_ELECT &&
610610 BarrierArriveAndWait (build_barrier , WAIT_EVENT_HASH_BUILD_ELECT ))
611611 {
612612 pstate -> nbatch = nbatch ;
@@ -627,7 +627,7 @@ ExecHashTableCreate(HashState *state, List *hashOperators, List *hashCollations,
627627 /*
628628 * The next Parallel Hash synchronization point is in
629629 * 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
631631 * executor node between now and then.
632632 */
633633 }
@@ -1075,7 +1075,7 @@ ExecParallelHashIncreaseNumBatches(HashJoinTable hashtable)
10751075{
10761076 ParallelHashJoinState * pstate = hashtable -> parallel_state ;
10771077
1078- Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_HASHING_INNER );
1078+ Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_HASH_INNER );
10791079
10801080 /*
10811081 * It's unlikely, but we need to be prepared for new participants to show
@@ -1084,7 +1084,7 @@ ExecParallelHashIncreaseNumBatches(HashJoinTable hashtable)
10841084 */
10851085 switch (PHJ_GROW_BATCHES_PHASE (BarrierPhase (& pstate -> grow_batches_barrier )))
10861086 {
1087- case PHJ_GROW_BATCHES_ELECTING :
1087+ case PHJ_GROW_BATCHES_ELECT :
10881088
10891089 /*
10901090 * Elect one participant to prepare to grow the number of batches.
@@ -1200,13 +1200,13 @@ ExecParallelHashIncreaseNumBatches(HashJoinTable hashtable)
12001200 }
12011201 /* Fall through. */
12021202
1203- case PHJ_GROW_BATCHES_ALLOCATING :
1203+ case PHJ_GROW_BATCHES_REALLOCATE :
12041204 /* Wait for the above to be finished. */
12051205 BarrierArriveAndWait (& pstate -> grow_batches_barrier ,
1206- WAIT_EVENT_HASH_GROW_BATCHES_ALLOCATE );
1206+ WAIT_EVENT_HASH_GROW_BATCHES_REALLOCATE );
12071207 /* Fall through. */
12081208
1209- case PHJ_GROW_BATCHES_REPARTITIONING :
1209+ case PHJ_GROW_BATCHES_REPARTITION :
12101210 /* Make sure that we have the current dimensions and buckets. */
12111211 ExecParallelHashEnsureBatchAccessors (hashtable );
12121212 ExecParallelHashTableSetCurrentBatch (hashtable , 0 );
@@ -1219,7 +1219,7 @@ ExecParallelHashIncreaseNumBatches(HashJoinTable hashtable)
12191219 WAIT_EVENT_HASH_GROW_BATCHES_REPARTITION );
12201220 /* Fall through. */
12211221
1222- case PHJ_GROW_BATCHES_DECIDING :
1222+ case PHJ_GROW_BATCHES_DECIDE :
12231223
12241224 /*
12251225 * Elect one participant to clean up and decide whether further
@@ -1274,7 +1274,7 @@ ExecParallelHashIncreaseNumBatches(HashJoinTable hashtable)
12741274 }
12751275 /* Fall through. */
12761276
1277- case PHJ_GROW_BATCHES_FINISHING :
1277+ case PHJ_GROW_BATCHES_FINISH :
12781278 /* Wait for the above to complete. */
12791279 BarrierArriveAndWait (& pstate -> grow_batches_barrier ,
12801280 WAIT_EVENT_HASH_GROW_BATCHES_FINISH );
@@ -1514,7 +1514,7 @@ ExecParallelHashIncreaseNumBuckets(HashJoinTable hashtable)
15141514 HashMemoryChunk chunk ;
15151515 dsa_pointer chunk_s ;
15161516
1517- Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_HASHING_INNER );
1517+ Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_HASH_INNER );
15181518
15191519 /*
15201520 * It's unlikely, but we need to be prepared for new participants to show
@@ -1523,7 +1523,7 @@ ExecParallelHashIncreaseNumBuckets(HashJoinTable hashtable)
15231523 */
15241524 switch (PHJ_GROW_BUCKETS_PHASE (BarrierPhase (& pstate -> grow_buckets_barrier )))
15251525 {
1526- case PHJ_GROW_BUCKETS_ELECTING :
1526+ case PHJ_GROW_BUCKETS_ELECT :
15271527 /* Elect one participant to prepare to increase nbuckets. */
15281528 if (BarrierArriveAndWait (& pstate -> grow_buckets_barrier ,
15291529 WAIT_EVENT_HASH_GROW_BUCKETS_ELECT ))
@@ -1552,13 +1552,13 @@ ExecParallelHashIncreaseNumBuckets(HashJoinTable hashtable)
15521552 }
15531553 /* Fall through. */
15541554
1555- case PHJ_GROW_BUCKETS_ALLOCATING :
1555+ case PHJ_GROW_BUCKETS_REALLOCATE :
15561556 /* Wait for the above to complete. */
15571557 BarrierArriveAndWait (& pstate -> grow_buckets_barrier ,
1558- WAIT_EVENT_HASH_GROW_BUCKETS_ALLOCATE );
1558+ WAIT_EVENT_HASH_GROW_BUCKETS_REALLOCATE );
15591559 /* Fall through. */
15601560
1561- case PHJ_GROW_BUCKETS_REINSERTING :
1561+ case PHJ_GROW_BUCKETS_REINSERT :
15621562 /* Reinsert all tuples into the hash table. */
15631563 ExecParallelHashEnsureBatchAccessors (hashtable );
15641564 ExecParallelHashTableSetCurrentBatch (hashtable , 0 );
@@ -1714,7 +1714,7 @@ ExecParallelHashTableInsert(HashJoinTable hashtable,
17141714
17151715 /* Try to load it into memory. */
17161716 Assert (BarrierPhase (& hashtable -> parallel_state -> build_barrier ) ==
1717- PHJ_BUILD_HASHING_INNER );
1717+ PHJ_BUILD_HASH_INNER );
17181718 hashTuple = ExecParallelHashTupleAlloc (hashtable ,
17191719 HJTUPLE_OVERHEAD + tuple -> t_len ,
17201720 & shared );
@@ -2868,7 +2868,7 @@ ExecParallelHashTupleAlloc(HashJoinTable hashtable, size_t size,
28682868 if (pstate -> growth != PHJ_GROWTH_DISABLED )
28692869 {
28702870 Assert (curbatch == 0 );
2871- Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_HASHING_INNER );
2871+ Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_HASH_INNER );
28722872
28732873 /*
28742874 * Check if our space limit would be exceeded. To avoid choking on
@@ -2988,7 +2988,7 @@ ExecParallelHashJoinSetUpBatches(HashJoinTable hashtable, int nbatch)
29882988 {
29892989 /* Batch 0 doesn't need to be loaded. */
29902990 BarrierAttach (& shared -> batch_barrier );
2991- while (BarrierPhase (& shared -> batch_barrier ) < PHJ_BATCH_PROBING )
2991+ while (BarrierPhase (& shared -> batch_barrier ) < PHJ_BATCH_PROBE )
29922992 BarrierArriveAndWait (& shared -> batch_barrier , 0 );
29932993 BarrierDetach (& shared -> batch_barrier );
29942994 }
@@ -3063,7 +3063,7 @@ ExecParallelHashEnsureBatchAccessors(HashJoinTable hashtable)
30633063 /*
30643064 * We should never see a state where the batch-tracking array is freed,
30653065 * 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.
30673067 */
30683068 Assert (DsaPointerIsValid (pstate -> batches ));
30693069
@@ -3146,7 +3146,7 @@ ExecHashTableDetachBatch(HashJoinTable hashtable)
31463146 * longer attached, but since there is no way it's moving after
31473147 * this point it seems safe to make the following assertion.
31483148 */
3149- Assert (BarrierPhase (& batch -> batch_barrier ) == PHJ_BATCH_DONE );
3149+ Assert (BarrierPhase (& batch -> batch_barrier ) == PHJ_BATCH_FREE );
31503150
31513151 /* Free shared chunks and buckets. */
31523152 while (DsaPointerIsValid (batch -> chunks ))
@@ -3189,13 +3189,12 @@ ExecHashTableDetach(HashJoinTable hashtable)
31893189
31903190 /*
31913191 * 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.
31943193 */
31953194 Assert (!pstate ||
3196- BarrierPhase (& pstate -> build_barrier ) >= PHJ_BUILD_RUNNING );
3195+ BarrierPhase (& pstate -> build_barrier ) >= PHJ_BUILD_RUN );
31973196
3198- if (pstate && BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_RUNNING )
3197+ if (pstate && BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_RUN )
31993198 {
32003199 int i ;
32013200
@@ -3218,7 +3217,7 @@ ExecHashTableDetach(HashJoinTable hashtable)
32183217 * Late joining processes will see this state and give up
32193218 * immediately.
32203219 */
3221- Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_DONE );
3220+ Assert (BarrierPhase (& pstate -> build_barrier ) == PHJ_BUILD_FREE );
32223221
32233222 if (DsaPointerIsValid (pstate -> batches ))
32243223 {
0 commit comments