Re: Disabled logical replication origin session causes primary key errors

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, Shawn McCoy <shawn(dot)the(dot)mccoy(at)gmail(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>, "drewwcallahan(at)gmail(dot)com" <drewwcallahan(at)gmail(dot)com>, "scott(at)meads(dot)us" <scott(at)meads(dot)us>
Subject: Re: Disabled logical replication origin session causes primary key errors
Date: 2025-04-23 15:58:27
Message-ID: CAD21AoD58SwtwwziTR4ssAGRwQsP=embtzhwgOqjY3vRWoog6w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Apr 23, 2025 at 2:01 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Wed, Apr 23, 2025 at 7:11 AM Hayato Kuroda (Fujitsu)
> <kuroda(dot)hayato(at)fujitsu(dot)com> wrote:
> >
> > > +# The bug was that the replication origin wasn’t updated whe
> > > +# apply_error_callback() was called with elevel >= ERROR, and the apply
> > > worker
> > > +# continued running afterward.
> > >
> > > I think it would be better to mention the fact that the problem
> > > happened when an error was caught for instance by a plpgsql function.
> > > How about rewriting it as follows?
> > >
> > > # The bug was that when an ERROR was caught, for instance by a
> > > PL/pgSQL function,
> > > # the apply worker reset the replication origin but continued processing
> > > # subsequent changes. This behavior resulted in a failure to update
> > > the replication
> > > # origin during further apply operations.
> >
> > I tried to describe the internal reasons of bugs, but yours did reported facts.
> > +1, replaced.
> >
>
> Pushed the patch after slightly changing the comments.

Thank you!

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2025-04-24 02:25:59 Re: Disabled logical replication origin session causes primary key errors
Previous Message Tom Lane 2025-04-23 14:41:40 Re: Command order bug in pg_dump