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

Method OnSendCheckpoint

src/algorithm/learner.cpp:828–864  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

826}
827
828void Learner :: OnSendCheckpoint(const CheckpointMsg & oCheckpointMsg)
829{
830 PLGHead("START uuid %lu flag %d sequence %lu cpi %lu checksum %u smid %d offset %lu buffsize %zu filepath %s",
831 oCheckpointMsg.uuid(), oCheckpointMsg.flag(), oCheckpointMsg.sequence(),
832 oCheckpointMsg.checkpointinstanceid(), oCheckpointMsg.checksum(), oCheckpointMsg.smid(),
833 oCheckpointMsg.offset(), oCheckpointMsg.buffer().size(), oCheckpointMsg.filepath().c_str());
834
835 int ret = 0;
836
837 if (oCheckpointMsg.flag() == CheckpointSendFileFlag_BEGIN)
838 {
839 ret = OnSendCheckpoint_Begin(oCheckpointMsg);
840 }
841 else if (oCheckpointMsg.flag() == CheckpointSendFileFlag_ING)
842 {
843 ret = OnSendCheckpoint_Ing(oCheckpointMsg);
844 }
845 else if (oCheckpointMsg.flag() == CheckpointSendFileFlag_END)
846 {
847 ret = OnSendCheckpoint_End(oCheckpointMsg);
848 }
849
850 if (ret != 0)
851 {
852 PLGErr("[FAIL] reset checkpoint receiver and reset askforlearn");
853
854 m_oCheckpointReceiver.Reset();
855
856 Reset_AskforLearn_Noop(5000);
857 SendCheckpointAck(oCheckpointMsg.nodeid(), oCheckpointMsg.uuid(), oCheckpointMsg.sequence(), CheckpointSendFileAckFlag_Fail);
858 }
859 else
860 {
861 SendCheckpointAck(oCheckpointMsg.nodeid(), oCheckpointMsg.uuid(), oCheckpointMsg.sequence(), CheckpointSendFileAckFlag_OK);
862 Reset_AskforLearn_Noop(120000);
863 }
864}
865
866int Learner :: SendCheckpointAck(
867 const nodeid_t iSendNodeID,

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected