| 227 | } |
| 228 | |
| 229 | comm::RetCode LockMgr::ReadRestartCheckpoint(const GroupVector::size_type paxos_group_id, |
| 230 | uint64_t &restart_checkpoint) { |
| 231 | comm::LockMgrBP::GetThreadInstance()-> |
| 232 | OnReadCheckpoint(impl_->lock->GetTopicID(), paxos_group_id); |
| 233 | |
| 234 | string vstr; |
| 235 | comm::RetCode ret{leveldb(paxos_group_id).Get(KEY_IGNORE_RESTART_CHECKPOINT, vstr)}; |
| 236 | |
| 237 | if (comm::RetCode::RET_ERR_KEY_NOT_EXIST == ret) { |
| 238 | restart_checkpoint = phxpaxos::NoCheckpoint; |
| 239 | QLErr("topic_id %d paxos_group_id %d not exist", |
| 240 | impl_->lock->GetTopicID(), paxos_group_id); |
| 241 | } else if (comm::RetCode::RET_OK == ret) { |
| 242 | restart_checkpoint = strtoul(vstr.c_str(), nullptr, 10); |
| 243 | QLInfo("topic_id %d paxos_group_id %d restart_cp %llu ok", |
| 244 | impl_->lock->GetTopicID(), paxos_group_id, restart_checkpoint); |
| 245 | } else { |
| 246 | restart_checkpoint = phxpaxos::NoCheckpoint; |
| 247 | QLErr("topic_id %d paxos_group_id %d err %d", |
| 248 | impl_->lock->GetTopicID(), paxos_group_id, ret); |
| 249 | } |
| 250 | |
| 251 | return ret; |
| 252 | } |
| 253 | |
| 254 | comm::RetCode LockMgr::WriteRestartCheckpoint(const GroupVector::size_type paxos_group_id, |
| 255 | const uint64_t restart_checkpoint) { |
nothing calls this directly
no test coverage detected