pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix assertion when decoding XLOG_PARAMETER_CHANGE on promoted pr
3+ messages / 1 participants
[nested] [flat]

* pgsql: Fix assertion when decoding XLOG_PARAMETER_CHANGE on promoted pr
@ 2025-02-24 22:04  Masahiko Sawada <msawada@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Masahiko Sawada @ 2025-02-24 22:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix assertion when decoding XLOG_PARAMETER_CHANGE on promoted primary.

When a standby replays an XLOG_PARAMETER_CHANGE record that lowers
wal_level below logical, we invalidate all logical slots in hot
standby mode. However, if this record was replayed while not in hot
standby mode, logical slots could remain valid even after promotion,
potentially causing an assertion failure during WAL record decoding.

To fix this issue, this commit adds a check for hot_standby status
when restoring a logical replication slot on standbys. This check
ensures that logical slots are invalidated when they become
incompatible due to insufficient wal_level during recovery.

Backpatch to v16 where logical decoding on standby was introduced.

Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Discussion: https://postgr.es/m/CAD21AoABoFwGY_Rh2aeE6tEq3HkJxf0c6UeOXn4VV9v6BAQPSw%40mail.gmail.com
Backpatch-through: 16

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/174952ece1c04b725a2eafabf08d7192b99866ca

Modified Files
--------------
src/backend/replication/slot.c                     | 29 +++++++++++++----
.../recovery/t/035_standby_logical_decoding.pl     | 38 ++++++++++++++++++++++
2 files changed, 61 insertions(+), 6 deletions(-)



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

* pgsql: Fix assertion when decoding XLOG_PARAMETER_CHANGE on promoted pr
@ 2025-02-24 22:04  Masahiko Sawada <msawada@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Masahiko Sawada @ 2025-02-24 22:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix assertion when decoding XLOG_PARAMETER_CHANGE on promoted primary.

When a standby replays an XLOG_PARAMETER_CHANGE record that lowers
wal_level below logical, we invalidate all logical slots in hot
standby mode. However, if this record was replayed while not in hot
standby mode, logical slots could remain valid even after promotion,
potentially causing an assertion failure during WAL record decoding.

To fix this issue, this commit adds a check for hot_standby status
when restoring a logical replication slot on standbys. This check
ensures that logical slots are invalidated when they become
incompatible due to insufficient wal_level during recovery.

Backpatch to v16 where logical decoding on standby was introduced.

Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Discussion: https://postgr.es/m/CAD21AoABoFwGY_Rh2aeE6tEq3HkJxf0c6UeOXn4VV9v6BAQPSw%40mail.gmail.com
Backpatch-through: 16

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/cc628f66187c56e0bfd1befee298755f7dfbf65e

Modified Files
--------------
src/backend/replication/slot.c                     | 29 +++++++++++++----
.../recovery/t/035_standby_logical_decoding.pl     | 38 ++++++++++++++++++++++
2 files changed, 61 insertions(+), 6 deletions(-)



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

* pgsql: Fix assertion when decoding XLOG_PARAMETER_CHANGE on promoted pr
@ 2025-02-24 22:04  Masahiko Sawada <msawada@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Masahiko Sawada @ 2025-02-24 22:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix assertion when decoding XLOG_PARAMETER_CHANGE on promoted primary.

When a standby replays an XLOG_PARAMETER_CHANGE record that lowers
wal_level below logical, we invalidate all logical slots in hot
standby mode. However, if this record was replayed while not in hot
standby mode, logical slots could remain valid even after promotion,
potentially causing an assertion failure during WAL record decoding.

To fix this issue, this commit adds a check for hot_standby status
when restoring a logical replication slot on standbys. This check
ensures that logical slots are invalidated when they become
incompatible due to insufficient wal_level during recovery.

Backpatch to v16 where logical decoding on standby was introduced.

Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Discussion: https://postgr.es/m/CAD21AoABoFwGY_Rh2aeE6tEq3HkJxf0c6UeOXn4VV9v6BAQPSw%40mail.gmail.com
Backpatch-through: 16

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/48796a98d5aed68e349118d4e05ac26b76c765b0

Modified Files
--------------
src/backend/replication/slot.c                     | 29 +++++++++++++----
.../recovery/t/035_standby_logical_decoding.pl     | 38 ++++++++++++++++++++++
2 files changed, 61 insertions(+), 6 deletions(-)



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


end of thread, other threads:[~2025-02-24 22:04 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-02-24 22:04 pgsql: Fix assertion when decoding XLOG_PARAMETER_CHANGE on promoted pr Masahiko Sawada <msawada@postgresql.org>
2025-02-24 22:04 pgsql: Fix assertion when decoding XLOG_PARAMETER_CHANGE on promoted pr Masahiko Sawada <msawada@postgresql.org>
2025-02-24 22:04 pgsql: Fix assertion when decoding XLOG_PARAMETER_CHANGE on promoted pr Masahiko Sawada <msawada@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