π€ This issue was generated by Claude on behalf of @keddie.
Hardening follow-up from the #1245 fix review (PR #1251). RaftLogMath.isLogUpToDate(ourLastTerm, ourLastIndex, candidateLastIndex, candidateLastTerm) orders the two sides oppositely β ours as (term, index), candidate as (index, term) (inherited from the wire-message field order). All current call sites are correct and VoteRestrictionSnapshotTest pins them, but a future caller swapping the two middle Longs compiles silently β in the vote-restriction path, a safety-critical function.
Fix: introduce a small LogPosition(term: Long, index: Long) value type (or use two same-ordered (term, index) pairs) so the compiler catches a swap. Low priority; ergonomic/future-proofing, not a current defect.
Hardening follow-up from the #1245 fix review (PR #1251).
RaftLogMath.isLogUpToDate(ourLastTerm, ourLastIndex, candidateLastIndex, candidateLastTerm)orders the two sides oppositely β ours as(term, index), candidate as(index, term)(inherited from the wire-message field order). All current call sites are correct andVoteRestrictionSnapshotTestpins them, but a future caller swapping the two middleLongs compiles silently β in the vote-restriction path, a safety-critical function.Fix: introduce a small
LogPosition(term: Long, index: Long)value type (or use two same-ordered(term, index)pairs) so the compiler catches a swap. Low priority; ergonomic/future-proofing, not a current defect.