pgsql: Make sure that hash join's bulk-tuple-transfer loops are interru

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Make sure that hash join's bulk-tuple-transfer loops are interru
Date: 2017-02-15 21:40:29
Message-ID: E1ce7JN-0007RX-8l@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Make sure that hash join's bulk-tuple-transfer loops are interruptible.

The loops in ExecHashJoinNewBatch(), ExecHashIncreaseNumBatches(), and
ExecHashRemoveNextSkewBucket() are all capable of iterating over many
tuples without ever doing a CHECK_FOR_INTERRUPTS, so that the backend
might fail to respond to SIGINT or SIGTERM for an unreasonably long time.
Fix that. In the case of ExecHashJoinNewBatch(), it seems useful to put
the added CHECK_FOR_INTERRUPTS into ExecHashJoinGetSavedTuple() rather
than directly in the loop, because that will also ensure that both
principal code paths through ExecHashJoinOuterGetTuple() will do a
CHECK_FOR_INTERRUPTS, which seems like a good idea to avoid surprises.

Back-patch to all supported branches.

Tom Lane and Thomas Munro

Discussion: https://postgr.es/m/6044.1487121720@sss.pgh.pa.us

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/030705e4fe27b4d3e9c9bfd38fda19e6d3be4248

Modified Files
--------------
src/backend/executor/nodeHash.c | 6 ++++++
src/backend/executor/nodeHashjoin.c | 7 +++++++
2 files changed, 13 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2017-02-15 22:31:34 pgsql: Doc: fix typo in logicaldecoding.sgml.
Previous Message Tom Lane 2017-02-15 20:41:22 pgsql: Doc: fix syntax synopsis for INSERT ... ON CONFLICT DO UPDATE.