fix(controller): checkpoints no longer punch a hole in the replicated log (bug-1870)
persist_checkpoint() and persist_checkpoint_marker_triggered() wrote a
local-only WAL_CHECKPOINT marker that consumed an LSN of the replicated log
(current_lsn++) but was never replicated. A checkpoint taken by one member
only -- the primary's periodic max-wal-records checkpoint, or the one before
a snapshot send -- left a hole no standby had: the leader's next entry
carried prev_log_index = the marker's LSN, logOk failed on every standby
forever, commits timed out and writes stalled ("could not submit 110 jobs"
in the --force-snapshot soak; reproduced on the pre-bug-1867 baseline). Even
the config-marker checkpoint, taken on every member, stamped the marker with
each member's own current_lsn at apply time, which need not agree.
Nothing reads the marker except to skip it, so checkpoints simply stop
writing it. The recovery, streamer and bug-1475 log_len skip paths stay, for
WALs written by older binaries; persist_test_write_legacy_checkpoint_marker()
(XCE_TESTING only) reproduces such a WAL for the tests that cover them.
- new test_bug1870_leader_only_checkpoint_leaves_no_log_hole (RED before):
a leader-only checkpoint takes no LSN and a standby that never
checkpointed catches up past it via the real streamer/receive path.
- test_checkpoint_writes_marker_to_wal inverted to ..._writes_no_marker_...
- bug-1475 x2 and the apply-correctness trailing-marker test now build
their legacy marker explicitly.
Controller suite 1234/0. HA soaks: --force-snapshot PASS (113 jobs, real
snapshot install -- also live-verifies bug-1867), --config-upgrade-wal-trim
PASS, --sequential 6 rounds PASS (SIMVERIFY 7 files, 0 mismatches).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
725301dd92
commit
63fd3d2afd
6 changed files with 139 additions and 20 deletions
|
|
@ -3295,7 +3295,11 @@ static int ha_apply_term_entry_via_library(ha_state_t *ha, persist_t *p,
|
|||
cluster_t *c, struct endpoint_t *ep,
|
||||
wal_catchup_entry_t *e)
|
||||
{
|
||||
/* bug-1475 / bug-1466: resync the raft library's log_len from this node's
|
||||
/* bug-1870: checkpoints no longer write WAL_CHECKPOINT markers, so new
|
||||
* logs have no such holes; this resync is kept for WALs written by older
|
||||
* binaries, whose markers still sit in the log.
|
||||
*
|
||||
* bug-1475 / bug-1466: resync the raft library's log_len from this node's
|
||||
* OWN recovered/durable WAL tip before consuming the AE, exactly mirroring
|
||||
* ha_sync_raft_log_from_recovery's boot-time computation (persist_durable_
|
||||
* floor), but applied live, JUST-IN-TIME, on this same single AE-receive
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue