MCPcopy Create free account
hub / github.com/Tencent/phxqueue / DumpCheckPoint

Method DumpCheckPoint

phxqueue/store/keepsyncthread.cpp:256–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256comm::RetCode KeepSyncThread::DumpCheckPoint(const int paxos_group_id, const uint64_t cp) {
257 QLVerb("KeepSyncThread::DumpCheckPoint");
258
259 if (-1 == cp) return comm::RetCode::RET_ERR_NO_NEED_DUMP_CHECKPOINT;
260
261 comm::RetCode ret;
262
263 auto stat = impl_->store->GetCheckPointStatMgr()->GetCheckPointStat(paxos_group_id);
264 if (!stat) {
265 QLErr("GetCheckPointStat fail paxos_group_id %d", paxos_group_id);
266 return comm::RetCode::RET_ERR_LOGIC;
267 }
268
269 uint64_t tmp_cp;
270 if (comm::RetCode::RET_OK != (ret = stat->GetCheckPoint(tmp_cp))) {
271 QLErr("GetCheckPoint ret %d paxos_group_id %d", ret, paxos_group_id);
272 return ret;
273 }
274
275 if (-1 != tmp_cp && tmp_cp > cp) return comm::RetCode::RET_ERR_NO_NEED_DUMP_CHECKPOINT;
276
277 if (comm::RetCode::RET_OK != (ret = stat->UpdateCheckPointAndFlush(cp))) {
278 QLErr("UpdateCheckPointAndFlush ret %d paxos_group_id %d cp %" PRIu64,
279 ret, paxos_group_id, cp);
280 return ret;
281 }
282
283 return comm::RetCode::RET_OK;
284}
285
286void KeepSyncThread::SyncCursorID() {
287 QLVerb("KeepSyncThread::SyncCursorID");

Callers

nothing calls this directly

Calls 4

GetCheckPointStatMethod · 0.80
GetCheckPointStatMgrMethod · 0.80
GetCheckPointMethod · 0.80

Tested by

no test coverage detected