-
Notifications
You must be signed in to change notification settings - Fork 168
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: error on ignored proposal and wait for EntryConfChange results #44
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1229,7 +1229,7 @@ func stepLeader(r *raft, m pb.Message) error { | |
|
||
if refused != "" { | ||
r.logger.Infof("%x ignoring conf change %v at config %s: %s", r.id, cc, r.prs.Config, refused) | ||
m.Entries[i] = pb.Entry{Type: pb.EntryNormal} | ||
return ErrProposalDropped | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know the side effect of dropping other entries in the same How about moving it til the end of stepLeader function, especially after There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the loop is only processing config changes, see There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see, thanks for the explanation! |
||
} else { | ||
r.pendingConfIndex = r.raftLog.lastIndex() + uint64(i) + 1 | ||
} | ||
|
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.
Switching to normal entry is trying to increase applied index so that the next confChange can be applicable. It seems that it is right move to return dropped if we have a way to update pendingConfIndex.
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.
I don't think switching to normal entry will make a difference here to increase applied index. The advance of applied index is triggered by etcd. But I agree returning proposal dropped early is helpful.
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.
You are right. The raft will update applied index even if the apply fails. I was thinking that the normal is used to catch up with pendingConfIndex so that it won't impact the following confChange.
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.
aha. Thanks for explanation! I think next
ProposeConfChange()
will succeed once theraft.Applied
is advanced by etcd raftNoder.Advance()
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.
For reference, the use of normal entry was added here
I think the idea was to support mixed list of entries (ConfChanges and Normal) in proposal, but is it even possible to get mixed list right now?
When I check for creation of
pb.Message{Type: pb.MsgProp
, there are two distinct places: