feat: support leader hint when NodeIsNotLeader#883
Conversation
fdd1b9b to
e9db9e8
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code Review SummaryRegression CheckAll modifications from main have been verified:
VerdictNo regressions, no blocking issues. The PR is ready to merge. |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Motivation
When a client sends a request to a non-leader node, the retry relies on the shard manager's assignment mapping, which may be stale. This PR enriches the
NodeIsNotLeadergRPC error with a leader hint so the client can retry directly to the correct leader, reducing retry latency during leadership changes.Modification
LeaderHintprotobuf message and embed it as gRPC status detail inNodeIsNotLeadererrors.shardAssignmentsIndexon the assignment dispatcher for O(log n) shard-to-leader lookup.WithFailureInjectionclient option andDizzyShardManagerfor testing.