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

Raft::sendRequestVote函数中RequestVote的来源问题 #47

Closed
Anu-orange opened this issue Mar 9, 2024 · 6 comments
Closed

Raft::sendRequestVote函数中RequestVote的来源问题 #47

Anu-orange opened this issue Mar 9, 2024 · 6 comments
Labels
question Further information is requested

Comments

@Anu-orange
Copy link

想询问一下在Raft::sendRequestVote函数中调用了RequestVote函数,该函数是调用的哪个函数,内部是怎么实现的??
019470a8a20cc3948632ea4c8cf75b6

Copy link

github-actions bot commented Mar 9, 2024

Message that will be displayed on users' first issue

@578223592
Copy link
Collaborator

@Anu-orange
如果你点进去就可以看到:
image
这部分是rpc的调用,其中最关键的是

stub_->RequestVote(&controller, args, response, nullptr);

这相当于调用了rpc的方法,对端接收到rpc后会调用:
image
,这个方法很简单,就是调用本机的RequestVote方法。
因此这个方法的功能就是通过RPC调用远端的RequestVote方法。

@578223592 578223592 added the question Further information is requested label Mar 11, 2024
@Anu-orange
Copy link
Author

@578223592
我好像明白您的意思了,意思就是stub_->RequestVote(&controller, args, response, nullptr)这个函数是由发起投票请求的Candidate调用的,而Raft::RequestVote这个函数是由接收请求的节点follower调用的对吧

@578223592
Copy link
Collaborator

@578223592 我好像明白您的意思了,意思就是stub_->RequestVote(&controller, args, response, nullptr)这个函数是由发起投票请求的Candidate调用的,而Raft::RequestVote这个函数是由接收请求的节点follower调用的对吧

YES @Anu-orange

@Anu-orange
Copy link
Author

@578223592
好的 谢谢您

@578223592
Copy link
Collaborator

我关闭这个issue了,如果有相关的任何问题,欢迎再打开。

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

2 participants