Compare commits

...

1 Commits

Author SHA1 Message Date
Heikki Linnakangas
d249299821 Don't pass InvalidTransactionId to update_next_xid.
update_next_xid() doesn't have any special treatment for the invalid
or other special XIDs, so it will treat InvalidTransactionId (0) as a
regular XID. If old nextXid is smaller than 2^31, 0 will look like a
very old XID, and nothing happens. But if nextXid is greater than 2^31
0 will look like a very new XID, and update_next_xid() will
incorrectly bump up nextXID.
2024-01-20 11:37:34 +02:00

View File

@@ -102,7 +102,9 @@ impl WalIngest {
buf.advance(decoded.main_data_offset);
assert!(!self.checkpoint_modified);
if self.checkpoint.update_next_xid(decoded.xl_xid) {
if decoded.xl_xid != pg_constants::INVALID_TRANSACTION_ID
&& self.checkpoint.update_next_xid(decoded.xl_xid)
{
self.checkpoint_modified = true;
}