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

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(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 06:03:54
Message-ID: CAFiTN-s1fWiHHKNqDV6k-84d2fxLRV9zDLNJC7dxEMO3zGLguQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 6, 2026 at 10:59 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> 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.")
>

Yeah this is better. I just have a suggestion that might sound better,
but feel free to ignore it.

errmsg("logical replication parallel apply worker exited due to error"),
errdetail("The leader apply worker will now exit and terminate any
other parallel apply workers.")

--
Regards,
Dilip Kumar
Google

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2026-11-06 06:09:45 Re: pg_dump --exclude-table loses FOR ALL TABLES EXCEPT publications
Previous Message Tatsuo Ishii 2026-11-06 05:46:11 Re: nodeWindowAgg.c IGNORE NULLS abs overflow