Skip to content

Commit

Permalink
add a debug log(FATAL)
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyu85cn committed Apr 8, 2022
1 parent 78a9edd commit 22003dc
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/kvstore/raftex/RaftPart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,21 @@ class AppendLogsIterator final : public LogIterator {
AppendLogsIterator& operator=(const AppendLogsIterator&) = delete;
AppendLogsIterator& operator=(AppendLogsIterator&&) = default;

~AppendLogsIterator() {
if (!logs_.empty()) {
size_t notFulfilledPromise = 0;
for (auto& log : logs_) {
auto& promiseRef = std::get<4>(log);
if (!promiseRef.isFulfilled()) {
++notFulfilledPromise;
}
}
if (notFulfilledPromise > 0) {
LOG(FATAL) << "notFulfilledPromise == " << notFulfilledPromise;
}
}
}

void commit(nebula::cpp2::ErrorCode code = nebula::cpp2::ErrorCode::SUCCEEDED) {
for (auto it = logs_.begin(); it != logs_.end(); ++it) {
auto& promiseRef = std::get<4>(*it);
Expand Down

0 comments on commit 22003dc

Please sign in to comment.