You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(raft): distinguish sync wait outcomes with syncResult enum
waitForBlockStoreSync previously returned bool, conflating three distinct
failure modes (ctx canceled, timeout, lost leadership). The caller in Run
then unconditionally called leadershipTransfer() on any false return, which
is wrong when leadership was already lost.
Introduce a syncResult enum (syncResultSynced, syncResultTimeout,
syncResultLostLeadership, syncResultCanceled) and update Run to handle each
case correctly:
- syncResultCanceled → return ctx.Err()
- syncResultLostLeadership → continue without calling leadershipTransfer()
- syncResultTimeout → leadershipTransfer() + continue as before
- syncResultSynced → refresh raftState/diff and proceed
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0 commit comments