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

提案通过后,为啥leader节点先执行状态机 #187

Open
ziyinweixiao opened this issue Jun 29, 2020 · 0 comments
Open

提案通过后,为啥leader节点先执行状态机 #187

ziyinweixiao opened this issue Jun 29, 2020 · 0 comments

Comments

@ziyinweixiao
Copy link

为什么提案通过后,leader 先执行状态机,这个优化点算是优化在哪里
void Learner :: ProposerSendSuccess(
const uint64_t llLearnInstanceID,
const uint64_t llProposalID)
{
BP->GetLearnerBP()->ProposerSendSuccess();

PaxosMsg oPaxosMsg;

oPaxosMsg.set_msgtype(MsgType_PaxosLearner_ProposerSendSuccess);
oPaxosMsg.set_instanceid(llLearnInstanceID);

NodeIDMsg * oNodeIDMsg = oPaxosMsg.mutable_nodeid();
NodeID2NodeIDMsg(m_poConfig->GetMyNodeID(), oNodeIDMsg);

oPaxosMsg.set_proposalid(llProposalID);
oPaxosMsg.set_lastchecksum(GetLastChecksum());

//run self first
BroadcastMessage(oPaxosMsg, BroadcastMessage_Type_RunSelf_First);

}

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

No branches or pull requests

1 participant