Skip to content
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

After the leader node submits the index, how to notify the follower to submit it #406

Closed
zsh1232 opened this issue Mar 23, 2020 · 4 comments
Labels
question Further information is requested

Comments

@zsh1232
Copy link

zsh1232 commented Mar 23, 2020

leader节点执行完状态机,把这次的index提交之后,什么时候通知的follower节点也提交呢? 我看现象是follower也立刻跟着提交了,但是这块代码没有找到。想问下具体是怎么实现的,谢谢~

@sofastack-bot sofastack-bot bot changed the title leader节点提交完index,如何通知给follower也进行提交的 After the leader node submits the index, how to notify the follower to submit it Mar 23, 2020
@sofastack-bot
Copy link

sofastack-bot bot commented Mar 23, 2020

Hi @zsh1232, we detect non-English characters in the issue. This comment is an auto translation by @sofastack-robot to help other users to understand this issue.

We encourage you to describe your issue in English which is more friendly to other users.

After the leader node executes the state machine, when the index is submitted, when will the notified follower node also submit? I see that the follower submitted immediately, but this code was not found. I want to ask how it is achieved, thank you ~

@sofastack-bot sofastack-bot bot added the question Further information is requested label Mar 23, 2020
@fengjiachun
Copy link
Contributor

leader 会往 follower 发送 lastCommittedIndex, 详情见

com.alipay.sofa.jraft.core.NodeImpl#handleAppendEntriesRequest
com.alipay.sofa.jraft.core.BallotBox#setLastCommittedIndex

@zsh1232
Copy link
Author

zsh1232 commented Mar 23, 2020

thank you~

@killme2008
Copy link
Contributor

源码阅读可以参考这里的文章

#327

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants