pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix an oversight in 3f28b2fcac.
3+ messages / 1 participants
[nested] [flat]

* pgsql: Fix an oversight in 3f28b2fcac.
@ 2025-04-23 05:40  Amit Kapila <akapila@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Amit Kapila @ 2025-04-23 05:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix an oversight in 3f28b2fcac.

Commit 3f28b2fcac tried to ensure that the replication origin shouldn't be
advanced in case of an ERROR in the apply worker, so that it can request
the same data again after restart. However, it is possible that an ERROR
was caught and handled by a (say PL/pgSQL) function, and  the apply worker
continues to apply further changes, in which case, we shouldn't reset the
replication origin.

Ensure to reset the origin only when the apply worker exits after an
ERROR.

Commit 3f28b2fcac added new function geterrlevel, which we removed in HEAD
as part of this commit, but kept it in backbranches to avoid breaking any
applications. A separate case can be made to have such a function even for
HEAD.

Reported-by: Shawn McCoy <shawn.the.mccoy@gmail.com>
Author: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: vignesh C <vignesh21@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Backpatch-through: 16, where it was introduced
Discussion: https://postgr.es/m/CALsgZNCGARa2mcYNVTSj9uoPcJo-tPuWUGECReKpNgTpo31_Pw@mail.gmail.com

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0de091a4b585bfb3ffa2dc1f6e7465db1d0b3eba

Modified Files
--------------
src/backend/replication/logical/worker.c | 21 +++++----
src/test/subscription/t/100_bugs.pl      | 77 ++++++++++++++++++++++++++++++++
2 files changed, 87 insertions(+), 11 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix an oversight in 3f28b2fcac.
@ 2025-04-23 05:40  Amit Kapila <akapila@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Amit Kapila @ 2025-04-23 05:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix an oversight in 3f28b2fcac.

Commit 3f28b2fcac tried to ensure that the replication origin shouldn't be
advanced in case of an ERROR in the apply worker, so that it can request
the same data again after restart. However, it is possible that an ERROR
was caught and handled by a (say PL/pgSQL) function, and  the apply worker
continues to apply further changes, in which case, we shouldn't reset the
replication origin.

Ensure to reset the origin only when the apply worker exits after an
ERROR.

Commit 3f28b2fcac added new function geterrlevel, which we removed in HEAD
as part of this commit, but kept it in backbranches to avoid breaking any
applications. A separate case can be made to have such a function even for
HEAD.

Reported-by: Shawn McCoy <shawn.the.mccoy@gmail.com>
Author: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: vignesh C <vignesh21@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Backpatch-through: 16, where it was introduced
Discussion: https://postgr.es/m/CALsgZNCGARa2mcYNVTSj9uoPcJo-tPuWUGECReKpNgTpo31_Pw@mail.gmail.com

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/05676d87e2e69a889abf75ce4f0c1bedde9ed71f

Modified Files
--------------
src/backend/replication/logical/worker.c | 21 +++++----
src/test/subscription/t/100_bugs.pl      | 77 ++++++++++++++++++++++++++++++++
2 files changed, 87 insertions(+), 11 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix an oversight in 3f28b2fcac.
@ 2025-04-23 05:40  Amit Kapila <akapila@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Amit Kapila @ 2025-04-23 05:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix an oversight in 3f28b2fcac.

Commit 3f28b2fcac tried to ensure that the replication origin shouldn't be
advanced in case of an ERROR in the apply worker, so that it can request
the same data again after restart. However, it is possible that an ERROR
was caught and handled by a (say PL/pgSQL) function, and  the apply worker
continues to apply further changes, in which case, we shouldn't reset the
replication origin.

Ensure to reset the origin only when the apply worker exits after an
ERROR.

Commit 3f28b2fcac added new function geterrlevel, which we removed in HEAD
as part of this commit, but kept it in backbranches to avoid breaking any
applications. A separate case can be made to have such a function even for
HEAD.

Reported-by: Shawn McCoy <shawn.the.mccoy@gmail.com>
Author: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: vignesh C <vignesh21@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Backpatch-through: 16, where it was introduced
Discussion: https://postgr.es/m/CALsgZNCGARa2mcYNVTSj9uoPcJo-tPuWUGECReKpNgTpo31_Pw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0e091ce409e06cd89baf81306cc92c496d8ba58d

Modified Files
--------------
src/backend/replication/logical/worker.c | 21 +++++----
src/backend/utils/error/elog.c           | 17 -------
src/include/utils/elog.h                 |  1 -
src/test/subscription/t/100_bugs.pl      | 77 ++++++++++++++++++++++++++++++++
4 files changed, 87 insertions(+), 29 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2025-04-23 05:40 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-04-23 05:40 pgsql: Fix an oversight in 3f28b2fcac. Amit Kapila <akapila@postgresql.org>
2025-04-23 05:40 pgsql: Fix an oversight in 3f28b2fcac. Amit Kapila <akapila@postgresql.org>
2025-04-23 05:40 pgsql: Fix an oversight in 3f28b2fcac. Amit Kapila <akapila@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox