Re: logical replication: restart_lsn can go backwards (and more), seems broken since 9.4
Tomas Vondra <tomas@vondra.me>
From: Tomas Vondra <tomas@vondra.me>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>,
Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2024-11-19T21:36:08Z
Lists: pgsql-hackers
Attachments
- 0001-asserts-restart_lsn.patch (text/x-patch) patch 0001
OK, Now that the fix is committed, shall we introduce some of the asserts? I believe there's an agreement the restart_lsn shouldn't move backwards, so I propose the attached patch. I still think not resetting the fields when releasing the slot, and allowing the values to move backwards is rather suspicious. But I don't have any reproducer demonstrating an issue (beyond just hitting an assert). Perhaps it's correct, but in that case it'd be good to add a comment explaining why that's the case. Sadly, it has to be written by someone else - I've been unable to form a justification why it's OK :-( regards -- Tomas Vondra
Commits
-
Fix a possibility of logical replication slot's restart_lsn going backwards.
- e5ed873b1b4a 18.0 landed
- 568e78a653ee 17.2 landed
- f353911337cf 16.6 landed
- 91771b3fbbc3 15.10 landed
- 26c4e8968690 14.15 landed
- 15dc1abb17dd 13.18 landed
-
Introduce logical decoding.
- b89e151054a0 9.4.0 cited