public inbox for [email protected]help / color / mirror / Atom feed
pgsql: Restrict copying of invalidated replication slots. 3+ messages / 1 participants [nested] [flat]
* pgsql: Restrict copying of invalidated replication slots. @ 2025-04-03 17:30 Masahiko Sawada <[email protected]> 0 siblings, 0 replies; 3+ messages in thread From: Masahiko Sawada @ 2025-04-03 17:30 UTC (permalink / raw) To: [email protected] Restrict copying of invalidated replication slots. Previously, invalidated logical and physical replication slots could be copied using the pg_copy_logical_replication_slot and pg_copy_physical_replication_slot functions. Replication slots that were invalidated for reasons other than WAL removal retained their restart_lsn. This meant that a new slot copied from an invalidated slot could have a restart_lsn pointing to a WAL segment that might have already been removed. This commit restricts the copying of invalidated replication slots. Backpatch to v16, where slots could retain their restart_lsn when invalidated for reasons other than WAL removal. For v15 and earlier, this check is not required since slots can only be invalidated due to WAL removal, and existing checks already handle this issue. Author: Shlok Kyal <[email protected]> Reviewed-by: vignesh C <[email protected]> Reviewed-by: Zhijie Hou <[email protected]> Reviewed-by: Peter Smith <[email protected]> Reviewed-by: Masahiko Sawada <[email protected]> Reviewed-by: Amit Kapila <[email protected]> Discussion: https://postgr.es/m/CANhcyEU65aH0VYnLiu%3DOhNNxhnhNhwcXBeT-jvRe1OiJTo_Ayg%40mail.gmail.com Backpatch-through: 16 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/fd09c1316bc37773d115d918dded660a7f5f08fb Modified Files -------------- doc/src/sgml/func.sgml | 6 ++++-- src/backend/replication/slotfuncs.c | 21 +++++++++++++++++++++ src/test/recovery/t/035_standby_logical_decoding.pl | 9 +++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Restrict copying of invalidated replication slots. @ 2025-04-03 17:30 Masahiko Sawada <[email protected]> 0 siblings, 0 replies; 3+ messages in thread From: Masahiko Sawada @ 2025-04-03 17:30 UTC (permalink / raw) To: [email protected] Restrict copying of invalidated replication slots. Previously, invalidated logical and physical replication slots could be copied using the pg_copy_logical_replication_slot and pg_copy_physical_replication_slot functions. Replication slots that were invalidated for reasons other than WAL removal retained their restart_lsn. This meant that a new slot copied from an invalidated slot could have a restart_lsn pointing to a WAL segment that might have already been removed. This commit restricts the copying of invalidated replication slots. Backpatch to v16, where slots could retain their restart_lsn when invalidated for reasons other than WAL removal. For v15 and earlier, this check is not required since slots can only be invalidated due to WAL removal, and existing checks already handle this issue. Author: Shlok Kyal <[email protected]> Reviewed-by: vignesh C <[email protected]> Reviewed-by: Zhijie Hou <[email protected]> Reviewed-by: Peter Smith <[email protected]> Reviewed-by: Masahiko Sawada <[email protected]> Reviewed-by: Amit Kapila <[email protected]> Discussion: https://postgr.es/m/CANhcyEU65aH0VYnLiu%3DOhNNxhnhNhwcXBeT-jvRe1OiJTo_Ayg%40mail.gmail.com Backpatch-through: 16 Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/a4309e85f4614315584e67737ea7b5efa19fb24c Modified Files -------------- doc/src/sgml/func.sgml | 6 ++++-- src/backend/replication/slotfuncs.c | 21 +++++++++++++++++++++ src/test/recovery/t/035_standby_logical_decoding.pl | 9 +++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Restrict copying of invalidated replication slots. @ 2025-04-03 17:30 Masahiko Sawada <[email protected]> 0 siblings, 0 replies; 3+ messages in thread From: Masahiko Sawada @ 2025-04-03 17:30 UTC (permalink / raw) To: [email protected] Restrict copying of invalidated replication slots. Previously, invalidated logical and physical replication slots could be copied using the pg_copy_logical_replication_slot and pg_copy_physical_replication_slot functions. Replication slots that were invalidated for reasons other than WAL removal retained their restart_lsn. This meant that a new slot copied from an invalidated slot could have a restart_lsn pointing to a WAL segment that might have already been removed. This commit restricts the copying of invalidated replication slots. Backpatch to v16, where slots could retain their restart_lsn when invalidated for reasons other than WAL removal. For v15 and earlier, this check is not required since slots can only be invalidated due to WAL removal, and existing checks already handle this issue. Author: Shlok Kyal <[email protected]> Reviewed-by: vignesh C <[email protected]> Reviewed-by: Zhijie Hou <[email protected]> Reviewed-by: Peter Smith <[email protected]> Reviewed-by: Masahiko Sawada <[email protected]> Reviewed-by: Amit Kapila <[email protected]> Discussion: https://postgr.es/m/CANhcyEU65aH0VYnLiu%3DOhNNxhnhNhwcXBeT-jvRe1OiJTo_Ayg%40mail.gmail.com Backpatch-through: 16 Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/87e8599e046f62bc4c1302c89ef58a881622e051 Modified Files -------------- doc/src/sgml/func.sgml | 4 +++- src/backend/replication/slotfuncs.c | 21 +++++++++++++++++++++ src/test/recovery/t/035_standby_logical_decoding.pl | 9 +++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2025-04-03 17:30 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2025-04-03 17:30 pgsql: Restrict copying of invalidated replication slots. Masahiko Sawada <[email protected]> 2025-04-03 17:30 pgsql: Restrict copying of invalidated replication slots. Masahiko Sawada <[email protected]> 2025-04-03 17:30 pgsql: Restrict copying of invalidated replication slots. Masahiko Sawada <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox