mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-26 09:30:37 +00:00
Fix truncating the wal after VCL.
This commit is contained in:
committed by
Stas Kelvich
parent
9e3fe2b4d4
commit
51b50f5cf5
@@ -263,10 +263,15 @@ TransferEntry(p, a) ==
|
||||
/\ next_e /= NULL
|
||||
/\ LET
|
||||
\* Consider bumping epoch if getting this entry recovers the acceptor,
|
||||
\* that is, we reach VCL.
|
||||
\* that is, we reach first record behind VCL. Strict comparison here
|
||||
\* is important: it is possible that <= vcl part of log is correct
|
||||
\* but there is a wrong tail which we must truncate before bumping
|
||||
\* epoch; getting first record from new epoch does the truncation.
|
||||
\* Another way to do this might be 'on receival of vcl record, if
|
||||
\* epoch is not bumped yet, truncate the log'.
|
||||
new_epoch ==
|
||||
IF /\ acc_state[a].epoch < prop_state[p].term
|
||||
/\ next_e.lsn >= prop_state[p].vcl
|
||||
/\ next_e.lsn > prop_state[p].vcl
|
||||
THEN
|
||||
prop_state[p].term
|
||||
ELSE
|
||||
|
||||
Reference in New Issue
Block a user