diff options
| author | Amit Kapila <akapila@postgresql.org> | 2025-11-28 05:21:35 +0000 |
|---|---|---|
| committer | Amit Kapila <akapila@postgresql.org> | 2025-11-28 05:21:35 +0000 |
| commit | e68b6adad96d414fdf24e072fdb1d41fb4b8f0b7 (patch) | |
| tree | 36cbdc3befc3b490893d4daa2184aa664ca46adb /src/test | |
| parent | 9ccc049dfe655ca9927f7c62559ec32f4d1f94dd (diff) | |
Add slotsync_skip_reason column to pg_replication_slots view.
Introduce a new column, slotsync_skip_reason, in the pg_replication_slots
view. This column records the reason why the last slot synchronization was
skipped. It is primarily relevant for logical replication slots on standby
servers where the 'synced' field is true. The value is NULL when
synchronization succeeds.
Author: Shlok Kyal <shlok.kyal.oss@gmail.com>
Reviewed-by: shveta malik <shveta.malik@gmail.com>
Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Reviewed-by: Ashutosh Sharma <ashu.coek88@gmail.com>
Reviewed-by: Hou Zhijie <houzj.fnst@fujitsu.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Discussion: https://postgr.es/m/CAE9k0PkhfKrTEAsGz4DjOhEj1nQ+hbQVfvWUxNacD38ibW3a1g@mail.gmail.com
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/recovery/t/040_standby_failover_slots_sync.pl | 6 | ||||
| -rw-r--r-- | src/test/regress/expected/rules.out | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/test/recovery/t/040_standby_failover_slots_sync.pl b/src/test/recovery/t/040_standby_failover_slots_sync.pl index 7d3c82e0a29..25777fa188c 100644 --- a/src/test/recovery/t/040_standby_failover_slots_sync.pl +++ b/src/test/recovery/t/040_standby_failover_slots_sync.pl @@ -1049,6 +1049,12 @@ $standby2->wait_for_log(qr/slot sync worker started/, $log_offset); $standby2->wait_for_log( qr/could not synchronize replication slot \"lsub1_slot\"/, $log_offset); +# Confirm that the slotsync skip reason is updated +$result = $standby2->safe_psql('postgres', + "SELECT slotsync_skip_reason FROM pg_replication_slots WHERE slot_name = 'lsub1_slot'" +); +is($result, 'wal_or_rows_removed', "check slot sync skip reason"); + # Confirm that the slotsync skip statistics is updated $result = $standby2->safe_psql('postgres', "SELECT slotsync_skip_count > 0 FROM pg_stat_replication_slots WHERE slot_name = 'lsub1_slot'" diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out index c337f0bc30d..94e45dd4d57 100644 --- a/src/test/regress/expected/rules.out +++ b/src/test/regress/expected/rules.out @@ -1507,8 +1507,9 @@ pg_replication_slots| SELECT l.slot_name, l.conflicting, l.invalidation_reason, l.failover, - l.synced - FROM (pg_get_replication_slots() l(slot_name, plugin, slot_type, datoid, temporary, active, active_pid, xmin, catalog_xmin, restart_lsn, confirmed_flush_lsn, wal_status, safe_wal_size, two_phase, two_phase_at, inactive_since, conflicting, invalidation_reason, failover, synced) + l.synced, + l.slotsync_skip_reason + FROM (pg_get_replication_slots() l(slot_name, plugin, slot_type, datoid, temporary, active, active_pid, xmin, catalog_xmin, restart_lsn, confirmed_flush_lsn, wal_status, safe_wal_size, two_phase, two_phase_at, inactive_since, conflicting, invalidation_reason, failover, synced, slotsync_skip_reason) LEFT JOIN pg_database d ON ((l.datoid = d.oid))); pg_roles| SELECT pg_authid.rolname, pg_authid.rolsuper, |
