fix(inkless:switch): keep consolidated records past a lowered seal [KC-837] #884
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 281 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.338
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #884"
general
weight: 0.35
giuseppelillo
lower-sealmoves the committed seal fromStoS' < S, but the diskless log still starts atS. Consolidation fetches atS'and appends the first diskless batch atS, so every replica's leader epoch cache mapsS', S)to the last classic epoch.hasConsolidatedDisklessSuffixFromSealread the epoch at the seal, got that classic epoch, and reported the consolidated records as a classic tail.maybeTruncateSwitchedFollowerandmaybeReconcileSwitchedLeaderthen truncated them toS', anddivergenceFromCommittedHistoryrecreated the replica on a new leader epoch.This hit every replica in phase 2. The leader that the seal was lowered to has the diskless leader epoch at
S'frommakeLeader, but the restart that the recovery needs bumps its leader epoch. The consolidated batch then replaces that entry with the diskless leader epoch atS.hasConsolidatedDisklessSuffixFromSealnow starts its proof at the first local batch that holds an offset at or past the seal. A batch that spans the seal still starts the proof at the seal. A classic record past the seal still fails the check. The check reads the log, not a cache entry that only consolidation writes, so it gives the same answer after a log directory move or a rebuild from remote storage.Test plan
ReplicaManagerInklessTest.testSwitchedReplicaKeepsConsolidatedRecordsAfterLoweredSealapplies a phase 2 delta with a new leader epoch to a replica with classic records[0, 7), a lowered seal7, and consolidated records[10, 13)in the diskless leader epoch. Its cache maps7to epoch0. The replica keeps its log as a leader, as a leader whose cache had a later epoch at7before the append, and as a follower.testSwitchedFollowerTruncatesOnlyClassicTailPastLoweredSealapplies a phase 1 follower delta. The follower keeps[10, 13)when its classic records end at the seal, and truncates to the seal when it holds a classic tail[7, 9).ReplicaManagerInklessTestandConsolidationFetcherThreadTestpass.🤖 Generated with [Claude Code