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

Method SendCheckpoint

src/algorithm/checkpoint_sender.cpp:158–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158void CheckpointSender :: SendCheckpoint()
159{
160 int ret = -1;
161 for (int i = 0; i < 2; i++)
162 {
163 ret = m_poLearner->SendCheckpointBegin(
164 m_iSendNodeID, m_llUUID, m_llSequence,
165 m_poSMFac->GetCheckpointInstanceID(m_poConfig->GetMyGroupIdx()));
166 if (ret != 0)
167 {
168 PLGErr("SendCheckpointBegin fail, ret %d", ret);
169 return;
170 }
171 }
172
173 BP->GetCheckpointBP()->SendCheckpointBegin();
174
175 m_llSequence++;
176
177 std::vector<StateMachine *> vecSMList = m_poSMFac->GetSMList();
178 for (auto & poSM : vecSMList)
179 {
180 ret = SendCheckpointFofaSM(poSM);
181 if (ret != 0)
182 {
183 return;
184 }
185 }
186
187 ret = m_poLearner->SendCheckpointEnd(
188 m_iSendNodeID, m_llUUID, m_llSequence,
189 m_poSMFac->GetCheckpointInstanceID(m_poConfig->GetMyGroupIdx()));
190 if (ret != 0)
191 {
192 PLGErr("SendCheckpointEnd fail, sequence %lu ret %d", m_llSequence, ret);
193 }
194
195 BP->GetCheckpointBP()->SendCheckpointEnd();
196}
197
198int CheckpointSender :: SendCheckpointFofaSM(StateMachine * poSM)
199{

Callers

nothing calls this directly

Calls 3

SendCheckpointBeginMethod · 0.80
SendCheckpointEndMethod · 0.80

Tested by

no test coverage detected