-
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
WIP: Durability issue fix in RAFT layer. #14406
Conversation
r.logger.Infof("Updating progress: %v", e.Index) | ||
r.prs.Progress[r.id].MaybeUpdate(e.Index) | ||
} | ||
r.maybeCommit() // TODO: Consider moving to stepLeader loop... |
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.
This isn't thread(goroutine) safe, because the raft may do it concurrently.
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.
No need to call r.maybeCommit()
if you follow comment
@@ -573,6 +573,11 @@ func (r *raft) advance(rd Ready) { | |||
if len(rd.Entries) > 0 { | |||
e := rd.Entries[len(rd.Entries)-1] | |||
r.raftLog.stableTo(e.Index, e.Term) | |||
if r.prs.Progress[r.id] != nil { | |||
r.logger.Infof("Updating progress: %v", e.Index) | |||
r.prs.Progress[r.id].MaybeUpdate(e.Index) |
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.
This isn't thread(goroutine) safe either, because it might trigger the map data-race 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.
You might need to construct a pb.MsgAppResp message and call (*node)Step()
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.
Agree. Was looking for a way to do this within 'raft' - without exiting to the 'node' level,
but calling r.Step() would be risky.
FYI. ahrtr@7ab0842 |
Agree that ahrtr@7ab0842 variant is better (i.e. explicit advancement of the state using .Step(Message) method. Let's iterate there. |
Sure, thx |
Closing as #14411 is superior to this. |
... still working on tests