Skip to content

Conversation

@VadimPushtaev
Copy link

When we logically replicate the message with LSN equal to exactly X, we need to wait for flush_pos of other replicas to become strictly greater than X, not greater or equal.

Both restart_lsn and confirmed_flush represent the oldest LSN that must still be kept so it can still be replicated. That means that it might NOT yet be replicated.

--

I made some trivial experiment to check how pg_failover_slots.standby_slot_names behaves and noticed that my logical replica always gets one extra record when the physical replica becomes unavailable. With this fix it works as expected: logical replica is never delayed more then necessary, but no records that were not replicated to physical replica are replicated to the logical one.

When we logically replicate the message with LSN equal to exactly X,
we need to wait for `flush_pos` of other replicas to become strictly
greater than X, not greater or equal.

Both `restart_lsn` and `confirmed_flush` represent the oldest LSN
that must still be kept so it can still be replicated. That means
that it might NOT yet be replicated.
@petere petere requested a review from PJMODOS September 18, 2025 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant