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

Method PlayLog

src/algorithm/instance.cpp:238–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236}
237
238int Instance :: PlayLog(const uint64_t llBeginInstanceID, const uint64_t llEndInstanceID)
239{
240 if (llBeginInstanceID < m_oCheckpointMgr.GetMinChosenInstanceID())
241 {
242 PLGErr("now instanceid %lu small than min chosen instanceid %lu",
243 llBeginInstanceID, m_oCheckpointMgr.GetMinChosenInstanceID());
244 return -2;
245 }
246
247 for (uint64_t llInstanceID = llBeginInstanceID; llInstanceID < llEndInstanceID; llInstanceID++)
248 {
249 AcceptorStateData oState;
250 int ret = m_oPaxosLog.ReadState(m_poConfig->GetMyGroupIdx(), llInstanceID, oState);
251 if (ret != 0)
252 {
253 PLGErr("log read fail, instanceid %lu ret %d", llInstanceID, ret);
254 return ret;
255 }
256
257 bool bExecuteRet = m_oSMFac.Execute(m_poConfig->GetMyGroupIdx(), llInstanceID, oState.acceptedvalue(), nullptr);
258 if (!bExecuteRet)
259 {
260 PLGErr("Execute fail, instanceid %lu", llInstanceID);
261 return -1;
262 }
263 }
264
265 return 0;
266}
267
268const uint32_t Instance :: GetLastChecksum()
269{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected