Remove overzealous assertion from PHJ.
authorThomas Munro <[email protected]>
Wed, 12 Apr 2023 21:19:54 +0000 (09:19 +1200)
committerThomas Munro <[email protected]>
Wed, 12 Apr 2023 21:37:54 +0000 (09:37 +1200)
We can't assert that we're the only process attached to a barrier after
BarrierArriveAndDetachExceptLast().  Although that'll be true almost
always, a late-starting parallel worker can attach very briefly (that
is, immediately detach after checking the phase) right at that moment.
BarrierArriveAndDetachExceptLast() already contains an assertion like
that, but it holds a spinlock preventing the race.  This thinko caused a
one-off failure on build farm animal chimaera.

Diagnosed-by: Melanie Plageman <[email protected]>
Reported-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/3590249.1680971629@sss.pgh.pa.us

src/backend/executor/nodeHash.c

index a45bd3a3156ba8816ee7f6513365ba90e2433a96..2e13ed17e16efb2511d0e2cc55b1b3775af6ded6 100644 (file)
@@ -2115,7 +2115,6 @@ ExecParallelPrepHashTableForUnmatched(HashJoinState *hjstate)
 
        /* Now we are alone with this batch. */
        Assert(BarrierPhase(&batch->batch_barrier) == PHJ_BATCH_SCAN);
-       Assert(BarrierParticipants(&batch->batch_barrier) == 1);
 
        /*
         * Has another process decided to give up early and command all processes