Re: Interrupts vs signals

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: Greg Burd <greg(at)burd(dot)me>, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Andres Freund <andres(at)anarazel(dot)de>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Subject: Re: Interrupts vs signals
Date: 2026-12-01 17:39:40
Message-ID: CA+TgmoZNM2w9i5wX8vdCSwTcKK=m7MHWxTO+T-g2ge6CrmsZbA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 30, 2026 at 7:04 PM Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:
> Thanks, here's a new version, which includes fixes for most of the
> issues you listed, and a whole bunch of other little fixes and cleanups.

ProcessParallelQueryMessage() is a piece of terminological
inexactitude: it's shared by everything that uses a ParallelContext,
which is more than just queries. But overall I think this is good
cleanup. Instead of having ProcessParallelMessageInterrupt() call
every function that might be interested, how about having a way for a
backend to temporarily change the function that gets called, or a
stack of functions to call? There's no reason to call the function for
parallel apply except from whatever process launches apply workers,
and there's no reason to call the function for repack unless we're
currently repacking. The generic parallel context function could maybe
be the default when nothing else is selected, or the thing we always
call in addition.

It's not a big deal, the other functions should exit quickly, but it
might be a little more clear, and scale better if people build more of
these.

An LLM review also points out that a parallel apply leader can
apparently launch parallel workers via a trigger running a parallel
SELECT, leading to the same process having both parallel workers and
apply workers. It thinks the patch regresses behavior in the case
where a parallel worker and an apply worker fail at the same time,
because ParallelMessagePending will get cleared but only the parallel
worker's message will get handled, since it throws an error. If the
leader then catches that error, the process continues with a pending
message but no flag set that will cause us to read it. It might be
best to prohibit parallel workers under an apply leader altogether,
but if we keep it, this patch should be careful about it.

--
Robert Haas
Databricks

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Jan Nidzwetzki 2026-12-01 17:27:28 Re: pg_rewind reports "no rewind required" due to stale minRecoveryPoint