aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorMasahiko Sawada <msawada@postgresql.org>2025-04-03 10:30:00 -0700
committerMasahiko Sawada <msawada@postgresql.org>2025-04-03 10:30:00 -0700
commitfd09c1316bc37773d115d918dded660a7f5f08fb (patch)
tree02cacae93f41c45d04486add9cdd5f268a94287e /doc/src
parentf104192e52fe01592689c6a896fb29facf03bd12 (diff)
downloadpostgresql-fd09c1316bc37773d115d918dded660a7f5f08fb.tar.gz
postgresql-fd09c1316bc37773d115d918dded660a7f5f08fb.zip
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 <shlok.kyal.oss@gmail.com> Reviewed-by: vignesh C <vignesh21@gmail.com> Reviewed-by: Zhijie Hou <houzj.fnst@fujitsu.com> Reviewed-by: Peter Smith <smithpb2250@gmail.com> Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Discussion: https://postgr.es/m/CANhcyEU65aH0VYnLiu%3DOhNNxhnhNhwcXBeT-jvRe1OiJTo_Ayg%40mail.gmail.com Backpatch-through: 16
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/func.sgml6
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 2488e9ba998..9f531e23283 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -29598,7 +29598,8 @@ postgres=# SELECT '0/0'::pg_lsn + pd.segment_number * ps.setting::int + :offset
The copied physical slot starts to reserve WAL from the same <acronym>LSN</acronym> as the
source slot.
<parameter>temporary</parameter> is optional. If <parameter>temporary</parameter>
- is omitted, the same value as the source slot is used.
+ is omitted, the same value as the source slot is used. Copy of an
+ invalidated slot is not allowed.
</para></entry>
</row>
@@ -29623,7 +29624,8 @@ postgres=# SELECT '0/0'::pg_lsn + pd.segment_number * ps.setting::int + :offset
The <literal>failover</literal> option of the source logical slot
is not copied and is set to <literal>false</literal> by default. This
is to avoid the risk of being unable to continue logical replication
- after failover to standby where the slot is being synchronized.
+ after failover to standby where the slot is being synchronized. Copy of
+ an invalidated slot is not allowed.
</para></entry>
</row>