Tencent / phxpaxos

The Paxos library implemented in C++ that has been used in the WeChat production environment.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

请问夺主时,BeforePropose起到什么作用?

liuliuwd opened this issue · comments

请问LearnMaster方法中,下面这段逻辑什么情况下会成立?
if (oMasterOper.lastversion() != 0
&& llInstanceID > m_llMasterVersion
&& oMasterOper.lastversion() != m_llMasterVersion)
{
BP->GetMasterBP()->MasterSMInconsistent();
PLG1Err("other last version %lu not same to my last version %lu, instanceid %lu",
oMasterOper.lastversion(), m_llMasterVersion, llInstanceID);

    PLG1Err("try to fix, set my master version %lu as other last version %lu, instanceid %lu",
            m_llMasterVersion, oMasterOper.lastversion(), llInstanceID);
    m_llMasterVersion = oMasterOper.lastversion();
}