On Mon, Sep 29, 2025 at 4:11 PM shveta malik <[email protected]> wrote: > > On Fri, Sep 26, 2025 at 3:26 PM Ajin Cherian <[email protected]> wrote: > > > > > > Attaching v4 which addresses all the above comments. > > > > Few trivial comments: > > 1) > # Confirm the synced slot 'lsub1_slot' is retained on the new primary > is( $standby1->safe_psql( > 'postgres', > - q{SELECT count(*) = 2 FROM pg_replication_slots WHERE slot_name IN > ('lsub1_slot', 'snap_test_slot') AND synced AND NOT temporary;} > + q{SELECT count(*) = 2 FROM pg_replication_slots WHERE slot_name IN > ('lsub1_slot', 'snap_test_slot') AND NOT synced AND NOT temporary;} > + > ), > 't', > 'synced slot retained on the new primary'); > > a) > It is not fault of this patch, but I see comment and query not > matching. We shall have both the names 'lsub1_slot', 'snap_test_slot' > in comment. >
Fixed. > b) Also it will be good to mention the expectation from synced flag in > the comment. How about: > > Confirm the synced slots 'lsub1_slot' and 'snap_test_slot' are > retained on the new primary and 'synced' flag is cleared on promotion. > Added. > 2) > As Ashutosh suggested, even in RestoreSlotFromDisk(), we can have > DEBUG1 msg: "synced flag reset for replication slot \"%s\"" > Added. Attaching patch v5 addressing the above changes. regards, Ajin Cherian Fujitsu Australia
v5-0001-Reset-synced-slots-when-a-standby-is-promoted.patch
Description: Binary data
