Open jcoleman opened 1 month ago
BTW the behavior here diverged from the documented behavior in https://github.com/2ndQuadrant/pglogical/commit/b72a61838b9a752668f70b89d1c56b1bc02de17b which sadly has no context in the commit message other than the fact that this was backported from pglogical3, so presumably there was an intentional reason to change this in v3, but there's no information as to why that's desirable, and the docs certainly weren't changed to match.
The docs for
pglogical.wait_slot_confirm_lsn
say:but looking at the code that's not what actually happens:
Contra the docs we use the LSN for the last commit performed on the current backend (if one is available). That means that it's possible for the following scenario to occur:
COMMIT (lsn 123)
;confirmed_flush_lsn = 0
COMMIT (lsn 456)
;confirmed_flush_lsn = 123
wait_slot_confirm_lsn(slot, NULL => turned into last commit at 123)
;confirmed_flush_lsn = 123
wait_slot_confirm_lsn
returnsCOMMIT (lsn 456)
replicates