On Mon, Nov 30, 2026 at 7:04 PM Heikki Linnakangas <[email protected]> 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
