fix bug-1060 bug-1067

This commit is contained in:
Rongsong Shen 2026-06-24 17:05:43 +08:00
parent 6067ba6c94
commit 61e1391cd0
28 changed files with 7021 additions and 2926 deletions

View file

@ -898,6 +898,17 @@ struct WalCatchupEntry $C.mapname("wal_catchup_entry_t") {
# the standby intake passes it into raft_on_append_entries_request. Append-only
# field number (@7) — no collision with the @4/@5/@6 term fields above.
leaderCommit @7 :UInt64 $C.mapname("leader_commit");
# bug-1067: the streaming leader's CURRENT term — the Raft AppendEntries header
# term (`term` arg of raft_on_append_entries_request), DISTINCT from `term` @4
# which is the entry's STORED term. For a live append the two are equal; for
# catch-up of a HISTORICAL entry written by a prior leader, the entry's stored
# term is LOWER than the current leader's term. Using the stored term as the AE
# header term made the library stale-reject every historical entry
# (ae_reject_stale), wedging cross-term catch-up. The standby intake uses this
# as the AE header term (UpdateTerm/stale-check) and keeps `term` @4 as the
# per-entry term (logOk / on_persist_entry). 0 = unset (legacy sender) → the
# intake falls back to the entry's stored term (the prior, live-only behaviour).
leaderCurrentTerm @8 :UInt64 $C.mapname("leader_current_term");
}
struct CtrlHelloRequest $C.mapname("ctrl_hello_req_t") {