pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Improve fix for not entering parallel mode when holding interrup
Date: Fri, 08 Nov 2024 18:42:18 +0000
Message-ID: <E1t9Tw1-000rNC-N4@gemulon.postgresql.org> (raw)

Improve fix for not entering parallel mode when holding interrupts.

Commit ac04aa84a put the shutoff for this into the planner, which is
not ideal because it doesn't prevent us from re-using a previously
made parallel plan.  Revert the planner change and instead put the
shutoff into InitializeParallelDSM, modeling it on the existing code
there for recovering from failure to allocate a DSM segment.

However, that code path is mostly untested, and testing a bit harder
showed there's at least one bug: ExecHashJoinReInitializeDSM is not
prepared for us to have skipped doing parallel DSM setup.  I also
thought the Assert in ReinitializeParallelWorkers is pretty
ill-advised, and replaced it with a silent Min() operation.

The existing test case added by ac04aa84a serves fine to test this
version of the fix, so no change needed there.

Patch by me, but thanks to Noah Misch for the core idea that we
could shut off worker creation when !INTERRUPTS_CAN_BE_PROCESSED.
Back-patch to v12, as ac04aa84a was.

Discussion: https://postgr.es/m/CAC-SaSzHUKT=vZJ8MPxYdC_URPfax+yoA1hKTcF4ROz_Q6z0_Q@mail.gmail.com

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/989ccd26c838f9393b45e547f22b64e469d1dc04

Modified Files
--------------
src/backend/access/transam/parallel.c | 19 ++++++++++++++++---
src/backend/executor/nodeHashjoin.c   |  9 +++++++--
src/backend/optimizer/plan/planner.c  |  6 ------
3 files changed, 23 insertions(+), 11 deletions(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1t9Tw1-000rNC-N4@gemulon.postgresql.org>
Permalink:  ../E1t9Tw1-000rNC-N4@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1t9Tw1-000rNC-N4@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Improve fix for not entering parallel mode when holding interrup
  In-Reply-To: <E1t9Tw1-000rNC-N4@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox