test(inkless:switch): run the stale high watermark promotion test in phase 2 [KC-721] #854
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 251 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.331
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #854"
general
weight: 0.35
viktorsomogyi
test_switched_leader_promotion_restores_stale_hwfails on main since#849 (KC-636). The test sets
unclean.leader.election.enable=truerightafter the seal commit, and the controller now rejects that config until
phase 2. The test cluster had no remote storage, so its switched partition
never left phase 1.
The old scenario can't happen in phase 1 anymore. There, the controller
elects only ISR members, and the old test needed unclean election to
promote a replica outside the ISR. In phase 2, remote storage holds the
prefix and the controller can elect any live replica. A replica with a
stale high watermark can still become leader there. This change reworks
the test to cover that case instead of removing it.
The test runs on a consolidation cluster with tiered storage on MinIO. It
switches with
remote.storage.enablein the same alter asdiskless.enable, and it waits forclassicPrefixInRemoteStoragebeforeit injects the stale high watermark checkpoint. The test stops the
promoted replica last instead of isolating it with a network partition.
It's then the last ISR member of the test topic and of the internal
topics, so the controller elects it without unclean election when it
restarts alone. It also leads
__remote_log_metadata, which it needs toserve the prefix from remote storage. The consumer must read every record
across the seal.
On main, the follower consolidation fetcher repairs the stale high
watermark before the promotion. The leader-side repair in
maybeReconcileSwitchedLeaderdoesn't run in this test, andtestApplyDeltaRestoresStaleHwmWhenSwitchedFollowerBecomesLeadercoversit.
The change also removes
_run_unclean_leader_election, which has no othercallers.
Testing
test_switched_leader_promotion_restores_stale_hwpasses twice in duckeron main. The logs show phase 2 at seal 5000, a broker reload with high
watermark 2500, a local log start offset of 5000, and 6000 records
consumed.
make valepasses.Assisted-by: Claude Opus 5.5