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

Method ChecksumLogic

src/algorithm/instance.cpp:821–850  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

819////////////////////////////////
820
821void Instance :: ChecksumLogic(const PaxosMsg & oPaxosMsg)
822{
823 if (oPaxosMsg.lastchecksum() == 0)
824 {
825 return;
826 }
827
828 if (oPaxosMsg.instanceid() != m_oAcceptor.GetInstanceID())
829 {
830 return;
831 }
832
833 if (m_oAcceptor.GetInstanceID() > 0 && GetLastChecksum() == 0)
834 {
835 PLGErr("I have no last checksum, other last checksum %u", oPaxosMsg.lastchecksum());
836 m_iLastChecksum = oPaxosMsg.lastchecksum();
837 return;
838 }
839
840 PLGHead("my last checksum %u other last checksum %u", GetLastChecksum(), oPaxosMsg.lastchecksum());
841
842 if (oPaxosMsg.lastchecksum() != GetLastChecksum())
843 {
844 PLGErr("checksum fail, my last checksum %u other last checksum %u",
845 GetLastChecksum(), oPaxosMsg.lastchecksum());
846 BP->GetInstanceBP()->ChecksumLogicFail();
847 }
848
849 assert(oPaxosMsg.lastchecksum() == GetLastChecksum());
850}
851
852//////////////////////////////////////////
853

Callers

nothing calls this directly

Calls 1

ChecksumLogicFailMethod · 0.80

Tested by

no test coverage detected