| 457 | } |
| 458 | |
| 459 | void Instance :: OnReceiveCheckpointMsg(const CheckpointMsg & oCheckpointMsg) |
| 460 | { |
| 461 | PLGImp("Now.InstanceID %lu MsgType %d Msg.from_nodeid %lu My.nodeid %lu flag %d" |
| 462 | " uuid %lu sequence %lu checksum %lu offset %lu buffsize %zu filepath %s", |
| 463 | m_oAcceptor.GetInstanceID(), oCheckpointMsg.msgtype(), oCheckpointMsg.nodeid(), |
| 464 | m_poConfig->GetMyNodeID(), oCheckpointMsg.flag(), oCheckpointMsg.uuid(), oCheckpointMsg.sequence(), oCheckpointMsg.checksum(), |
| 465 | oCheckpointMsg.offset(), oCheckpointMsg.buffer().size(), oCheckpointMsg.filepath().c_str()); |
| 466 | |
| 467 | if (oCheckpointMsg.msgtype() == CheckpointMsgType_SendFile) |
| 468 | { |
| 469 | if (!m_oCheckpointMgr.InAskforcheckpointMode()) |
| 470 | { |
| 471 | PLGImp("not in ask for checkpoint mode, ignord checkpoint msg"); |
| 472 | return; |
| 473 | } |
| 474 | |
| 475 | m_oLearner.OnSendCheckpoint(oCheckpointMsg); |
| 476 | } |
| 477 | else if (oCheckpointMsg.msgtype() == CheckpointMsgType_SendFile_Ack) |
| 478 | { |
| 479 | m_oLearner.OnSendCheckpointAck(oCheckpointMsg); |
| 480 | } |
| 481 | } |
| 482 | |
| 483 | int Instance :: OnReceivePaxosMsg(const PaxosMsg & oPaxosMsg, const bool bIsRetry) |
| 484 | { |