Re: Disabled logical replication origin session causes primary key errors
Masahiko Sawada <sawada.mshk@gmail.com>
From: Masahiko Sawada <sawada.mshk@gmail.com>
To: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>,
Shawn McCoy <shawn.the.mccoy@gmail.com>, "pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>, "drewwcallahan@gmail.com" <drewwcallahan@gmail.com>,
"scott@meads.us" <scott@meads.us>
Date: 2025-04-21T17:00:05Z
Lists: pgsql-bugs
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix an oversight in 3f28b2fcac.
- 0e091ce409e0 18.0 landed
- 05676d87e2e6 17.5 landed
- 0de091a4b585 16.9 landed
-
Don't advance origin during apply failure.
- 3f28b2fcac33 18.0 cited
On Mon, Apr 21, 2025 at 3:08 AM Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com> wrote: > > Dear members, > > Thanks for reporting the issue. > > > Right. We have wrongly assumed in that commit that the apply worker > > will exit after an ERROR, but as shown by this case, the ERROR could > > be silently handled. So, +1, for moving replication origin reset to > > PG_CATCH in start_apply. > > I was an author of original commit, so let me take initiative. When I was working > for 3f28b2fcac, I could not find path which ERROR is reported but worker can > survive so that I added replorigin_reset() in apply_error_callback(). The reported > case, however, the exception could be raised but the insert itself is committed. > In this case worker can continue working. > > Attached patches have proposed changes. I did 1) meson test, 2) workloads provided > in [1], and 3) manual tests done in original thread [2], and all of them could be > passed. The version is 2 because of the self-reviewing. > > One note is that geterrlevel() is removed for HEAD patch but retained for PG16/PG17. > The function is exported, and APIs cannot be changed in back branches. Thank you for the patch. The changes look reasonable to me. Can we add some regression tests for that? Regards, -- Masahiko Sawada Amazon Web Services: https://aws.amazon.com