Re: Incorrect CONTEXT reported for errors from parallel apply worker in logical replication

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Incorrect CONTEXT reported for errors from parallel apply worker in logical replication
Date: 2026-11-06 05:29:48
Message-ID: CAA4eK1Kqu1-rjRa6TpVOTMrkyhGgYKWnWL9JxyU_HfQbWm8yqw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 5, 2026 at 4:52 PM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
>
> 2.
> ereport(ERROR,
> (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
> - errmsg("logical replication parallel apply worker exited due to error"),
> - errcontext("%s", edata.context)));
> + errmsg("logical replication parallel apply worker exited due to
> error, exiting leader as well")));
>
> Do we really need ", exiting leader as well"" part of the error
> message? I mean if we just say "logical replication parallel apply
> worker exited due to error" isn't it obvious that leader will be
> exited as well with elevel ERROR.
>

Yes, but also note that on error/stop of leader apply worker, other
parallel apply workers will also be terminated. See
logicalrep_worker_onexit. How about slightly more descriptive message
as follows or something on those lines:
errmsg("logical replication parallel apply worker exited due to error"),
errdetail("The apply worker will now exit, which also stops the other
parallel apply workers.")

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2026-11-06 05:46:11 Re: nodeWindowAgg.c IGNORE NULLS abs overflow
Previous Message Michael Paquier 2026-11-06 05:26:21 Re: Reject access to unlogged tables in contrib modules