-
Notifications
You must be signed in to change notification settings - Fork 17
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
Log is being applied on restart #7
Comments
@kotyara85 depends on the node state, if when it restarted it lost durable storage then the leader will send out all logs again if there was a snapshot the leader will not send a diff it will send out a snapshot instead. what was the term and index of the node before and after restart? |
@shaj13 sorry for the late reply, apply triggers on the local node and doesn't seem like affecting other nodes in the cluster. Does that mean I should somehow keep latest index and ignore all updates? |
Oh, And how do I get a current index? Doesn't seem like there's any interfaces on the node object which allow to fetch taht |
Ok, i figured out the snapshot situation |
Great to know, can you tell what was the issue with snapshot situation ? you can do the following to check if current node is leader: func IsLeader(n *raft.Node) bool {
retrun n.Whoami() == n.Leader()
} as well you can wrap it with a time.Ticker to report to a chan when its promoted to be a leader. |
Hello,
Is it an expected behavior?
After a node is restarted I see it fetches all the data from the leader
I'd expect it to get only the diff
Thanks
The text was updated successfully, but these errors were encountered: