postgresql/contrib/test_decoding/expected
Amit Kapila ddd5f4f54a Add a slot synchronization function.
This commit introduces a new SQL function pg_sync_replication_slots()
which is used to synchronize the logical replication slots from the
primary server to the physical standby so that logical replication can be
resumed after a failover or planned switchover.

A new 'synced' flag is introduced in pg_replication_slots view, indicating
whether the slot has been synchronized from the primary server. On a
standby, synced slots cannot be dropped or consumed, and any attempt to
perform logical decoding on them will result in an error.

The logical replication slots on the primary can be synchronized to the
hot standby by using the 'failover' parameter of
pg-create-logical-replication-slot(), or by using the 'failover' option of
CREATE SUBSCRIPTION during slot creation, and then calling
pg_sync_replication_slots() on standby. For the synchronization to work,
it is mandatory to have a physical replication slot between the primary
and the standby aka 'primary_slot_name' should be configured on the
standby, and 'hot_standby_feedback' must be enabled on the standby. It is
also necessary to specify a valid 'dbname' in the 'primary_conninfo'.

If a logical slot is invalidated on the primary, then that slot on the
standby is also invalidated.

If a logical slot on the primary is valid but is invalidated on the
standby, then that slot is dropped but will be recreated on the standby in
the next pg_sync_replication_slots() call provided the slot still exists
on the primary server. It is okay to recreate such slots as long as these
are not consumable on standby (which is the case currently). This
situation may occur due to the following reasons:
- The 'max_slot_wal_keep_size' on the standby is insufficient to retain
WAL records from the restart_lsn of the slot.
- 'primary_slot_name' is temporarily reset to null and the physical slot
is removed.

The slot synchronization status on the standby can be monitored using the
'synced' column of pg_replication_slots view.

A functionality to automatically synchronize slots by a background worker
and allow logical walsenders to wait for the physical will be done in
subsequent commits.

Author: Hou Zhijie, Shveta Malik, Ajin Cherian based on an earlier version by Peter Eisentraut
Reviewed-by: Masahiko Sawada, Bertrand Drouvot, Peter Smith, Dilip Kumar, Nisha Moond, Kuroda Hayato, Amit Kapila
Discussion: https://postgr.es/m/514f6f2f-6833-4539-39f1-96cd1e011f23@enterprisedb.com
2024-02-14 09:45:36 +05:30
..
binary.out
catalog_change_snapshot.out Fix assertion failures while processing NEW_CID record in logical decoding. 2022-10-20 08:49:48 +05:30
concurrent_ddl_dml.out Improve display of query results in isolation tests. 2021-06-23 11:13:00 -04:00
concurrent_stream.out Remove incidental md5() function uses from several tests 2023-07-04 14:31:57 +02:00
ddl.out Catalog not-null constraints 2023-08-25 13:31:24 +02:00
decoding_in_xact.out Revert "Logical decoding of sequences" 2022-04-07 20:06:36 +02:00
decoding_into_rel.out Revert "Logical decoding of sequences" 2022-04-07 20:06:36 +02:00
delayed_startup.out Improve display of query results in isolation tests. 2021-06-23 11:13:00 -04:00
messages.out Add flush option to pg_logical_emit_message() 2023-10-18 11:24:59 +09:00
mxact.out Revert "Logical decoding of sequences" 2022-04-07 20:06:36 +02:00
oldest_xmin.out Improve display of query results in isolation tests. 2021-06-23 11:13:00 -04:00
ondisk_startup.out Revert "Logical decoding of sequences" 2022-04-07 20:06:36 +02:00
permissions.out Add a slot synchronization function. 2024-02-14 09:45:36 +05:30
prepared.out
replorigin.out Fix the misuse of origin filter across multiple pg_logical_slot_get_changes() calls. 2023-09-27 14:32:51 +05:30
rewrite.out Revert "Logical decoding of sequences" 2022-04-07 20:06:36 +02:00
slot.out Add a slot synchronization function. 2024-02-14 09:45:36 +05:30
slot_creation_error.out Close race condition in slot_creation_error.spec. 2022-03-18 18:18:00 -07:00
snapshot_transfer.out Improve display of query results in isolation tests. 2021-06-23 11:13:00 -04:00
spill.out
stats.out pgstat: add/extend tests for resetting various kinds of stats. 2022-04-07 15:43:43 -07:00
stream.out Add STREAM_START/STREAM_STOP for transactional messages during decoding. 2023-10-30 14:36:21 +05:30
subxact_without_top.out Improve display of query results in isolation tests. 2021-06-23 11:13:00 -04:00
time.out
toast.out Revert "Logical decoding of sequences" 2022-04-07 20:06:36 +02:00
truncate.out Revert "Logical decoding of sequences" 2022-04-07 20:06:36 +02:00
twophase.out test_decoding: Remove unnecessary table in twophase test 2023-10-10 17:49:22 +09:00
twophase_snapshot.out Improve display of query results in isolation tests. 2021-06-23 11:13:00 -04:00
twophase_stream.out Add STREAM_START/STREAM_STOP for transactional messages during decoding. 2023-10-30 14:36:21 +05:30
xact.out