Skip to content

Commit

Permalink
try fix a dead lock
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyu85cn committed Apr 1, 2022
1 parent 329cbd0 commit 8ef6ec9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 4 additions & 6 deletions src/kvstore/raftex/RaftPart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ class AppendLogsIteratorFactory {
}

// if we try to read a key, in any range
// for (auto& [begin, end] : ranges) {
for (auto& it : ranges) {
auto* begin = it.first.c_str();
auto* end = it.second.c_str();
Expand Down Expand Up @@ -1052,13 +1051,12 @@ void RaftPart::processAppendLogResponses(const AppendLogResponses& resps,
replicatingLogs_ = false;
return;
}
auto firstId = lastLogId_ + 1;
AppendLogsIterator it(firstId, currTerm, std::move(sendingLogs_));
this->appendLogsInternal(std::move(it), currTerm);
}

return;
}
auto firstId = lastLogId_ + 1;
AppendLogsIterator it(firstId, currTerm, std::move(sendingLogs_));
this->appendLogsInternal(std::move(it), currTerm);
return;
} else {
// Not enough hosts accepted the log, re-try
VLOG_EVERY_N(2, 1000) << idStr_ << "Only " << numSucceeded
Expand Down
2 changes: 0 additions & 2 deletions src/storage/test/ChainAddEdgesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
namespace nebula {
namespace storage {

/*
constexpr int32_t mockSpaceId = 1;
constexpr int32_t mockPartNum = 1;
constexpr int32_t fackTerm = 1;
Expand Down Expand Up @@ -195,7 +194,6 @@ TEST(ChainAddEdgesTest, processRemoteTest) {
auto reversedRequest = proc->reverseRequestForward(req);
delete proc;
}
*/

} // namespace storage
} // namespace nebula
Expand Down

0 comments on commit 8ef6ec9

Please sign in to comment.