Re: Missing CHECK_FOR_INTERRUPTS in hash joins
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2017-02-15T21:03:06Z
Lists: pgsql-hackers
Thomas Munro <thomas.munro@enterprisedb.com> writes: > On Wed, Feb 15, 2017 at 2:22 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote: >> Adding a C.F.I. inside this loop is the most straightforward fix, but >> I am leaning towards adding one in ExecHashJoinGetSavedTuple instead, > Would it also make sense to put one in the loop in > ExecHashIncreaseNumBatches (or perhaps > ExecHashJoinSaveTuple for symmetry with the above)? Otherwise you > might have to wait for a few hundred MB of tuples to be written out > which could be slow if IO is somehow overloaded. Mmm, good point. I think in that case the C.F.I. had better be in the loop in ExecHashIncreaseNumBatches, because if you were unlucky the loop might not take the ExecHashJoinSaveTuple path for a long time. Looking around at other callers of ExecHashJoinSaveTuple, the only one that seems to be in need of a C.F.I. is the loop in ExecHashRemoveNextSkewBucket, and there again there's a code path whereby the loop doesn't call ExecHashJoinSaveTuple. Will CFI-ify all three places. regards, tom lane
Commits
-
Make sure that hash join's bulk-tuple-transfer loops are interruptible.
- d0e9c0e3199c 9.4.12 landed
- 96ba17640055 9.5.7 landed
- 6a4941f8c622 9.3.17 landed
- 030705e4fe27 9.2.21 landed
- f2ec57dee93b 10.0 landed
- 354dfa235b4d 9.6.3 landed