| From: | Sami Imseih <samimseih(dot)pg(at)gmail(dot)com> |
|---|---|
| To: | Antonin Houska <ah(at)cybertec(dot)at> |
| Cc: | pgsql-hackers(at)lists(dot)postgresql(dot)org |
| Subject: | Re: Race conditions during parallel worker (unclean) exit |
| Date: | 2026-09-10 21:09:47 |
| Message-ID: | CAN12+YJXg7_EXyB_N8FoMar_NtkyA8T1eAmKLBYNA41hMcZeMQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
> > > > It seems cleaner to introduce a separate message for this case, maybe
> > > > "PqMsg_ParallelAborted", and keep the existing
> > > > "ERROR: lost connection to parallel worker" message.
> > >
> > > I'm not sure this is worth adjusting the FE/BE protocol. I'd prefer regular
> > > ERROR message (PqMsg_ErrorResponse), but only in some minimalistic form. The
> > > worker would only send the message, w/o doing any error handling itself.
> >
>
> > I was thinking of PqMsg_ParallelAborted because we have precedent already
> > with PqMsg_Progress which was introduced in f1889729dd3a as the 'P' message
> > for parallel index progress reported, but later converted to a macro in
> > a99cc6c6b4b.
>
> I realize now that new message type for communication between background
> worker and the leader backend actually shouldn't need the protocol version to
> be bumped - see commit f1889729dd3a.
Right.
> A new message, e.g. PqMsg_WorkerExit, would contain status code. The worker
> would set zero status code when sending the message at the end of
> ParallelWorkerMain(), and non-zero in ParallelWorkerShutdown(). Does that make
> sense to you?
That does sound logical to me. Maybe PqParallelMsg_WorkerExit to match the new
prefix in 8367b63e2cabb.
So, this also means we can be more precise in the error message. Rather than
"lost connection to parallel worker", we can report something like
"parallel worker exited with exit code <n>" when ProcessParallelMessage()
receives a worker exit message indicating that the worker exited
abnormally.
--
Sami Imseih
Amazon Web Services (AWS)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bharath Rupireddy | 2026-09-10 21:14:00 | Re: Support for 8-byte TOAST values, round two |
| Previous Message | Daniel Gustafsson | 2026-09-10 21:08:07 | Re: Trying to break online checksums with LLMs |