MCPcopy Create free account
hub / github.com/Tencent/phxpaxos / TransmitToFollower

Method TransmitToFollower

src/algorithm/learner.cpp:544–564  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

542//////////////////////////////////////////////////////////////
543
544void Learner :: TransmitToFollower()
545{
546 if (m_poConfig->GetMyFollowerCount() == 0)
547 {
548 return;
549 }
550
551 PaxosMsg oPaxosMsg;
552
553 oPaxosMsg.set_msgtype(MsgType_PaxosLearner_SendLearnValue);
554 oPaxosMsg.set_instanceid(GetInstanceID());
555 oPaxosMsg.set_nodeid(m_poConfig->GetMyNodeID());
556 oPaxosMsg.set_proposalnodeid(m_poAcceptor->GetAcceptorState()->GetAcceptedBallot().m_llNodeID);
557 oPaxosMsg.set_proposalid(m_poAcceptor->GetAcceptorState()->GetAcceptedBallot().m_llProposalID);
558 oPaxosMsg.set_value(m_poAcceptor->GetAcceptorState()->GetAcceptedValue());
559 oPaxosMsg.set_lastchecksum(GetLastChecksum());
560
561 BroadcastMessageToFollower(oPaxosMsg, Message_SendType_TCP);
562
563 PLGHead("ok");
564}
565
566void Learner :: ProposerSendSuccess(
567 const uint64_t llLearnInstanceID,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected