-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
raft: let raft step return error when proposal is dropped to allow fail-fast #9067
Conversation
ae6f2c4
to
63d14e3
Compare
63d14e3
to
4081815
Compare
Seems the commit message |
can you separate the PR into smaller ones? I think the first one can be then we can hook it up with etcd, and upper layers. |
4081815
to
3bc5754
Compare
The PR is separated now. |
b5b998b
to
a4b7655
Compare
Codecov Report
@@ Coverage Diff @@
## master #9067 +/- ##
==========================================
- Coverage 76.25% 75.97% -0.29%
==========================================
Files 359 359
Lines 29983 29988 +5
==========================================
- Hits 22864 22783 -81
- Misses 5541 5611 +70
- Partials 1578 1594 +16
Continue to review full report at Codecov.
|
raft/raft.go
Outdated
@@ -67,6 +67,8 @@ const ( | |||
campaignTransfer CampaignType = "CampaignTransfer" | |||
) | |||
|
|||
var ErrProposalDropped = errors.New("raft proposal dropped") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doc string on public error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// ErrProposalDropped is returned by the Step function when the passed in proposal is dropped.
lgtm. /cc @siddontang @bdarnell |
@absolute8511 Can you please add the comment to the error message? then i will get this PR merged right away. |
a4b7655
to
30ced5b
Compare
@absolute8511 thanks. looking forward to follow up PRs to hook this up with etcd application layer. |
While the leader is transferring or some other states which the raft node may drop the proposal, we should fail fast to notify the proposal cancelled.
This should fix issue #8975 and #8977