Skip to content

Commit

Permalink
Remove the unreasonable check inside host
Browse files Browse the repository at this point in the history
  • Loading branch information
heng committed Aug 21, 2019
1 parent 7012a56 commit 7f776c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/kvstore/raftex/Host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,11 @@ folly::Future<cpp2::AppendLogResponse> Host::appendLogs(
lastLogIdSent_ = prevLogId;
lastLogTermSent_ = prevLogTerm;
}
CHECK_GE(prevLogTerm, lastLogTermSent_);
CHECK_GE(prevLogId, lastLogIdSent_);
if (prevLogTerm < lastLogTermSent_ || prevLogId < lastLogIdSent_) {
LOG(INFO) << idStr_ << "We have sended this log, so go on from id " << lastLogIdSent_
<< ", term " << lastLogTermSent_ << "; current prev log id " << prevLogId
<< ", current prev log term " << prevLogTerm;
}
logTermToSend_ = term;
logIdToSend_ = logId;
committedLogId_ = committedLogId;
Expand Down
2 changes: 1 addition & 1 deletion src/kvstore/raftex/test/SnapshotTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ namespace raftex {

TEST(SnapshotTest, LearnerCatchUpDataTest) {
fs::TempDir walRoot("/tmp/catch_up_data.XXXXXX");
FLAGS_wal_ttl = 1;
FLAGS_wal_file_size = 128;
FLAGS_wal_buffer_size = 64;
FLAGS_wal_buffer_num = 1000;
Expand Down Expand Up @@ -64,6 +63,7 @@ TEST(SnapshotTest, LearnerCatchUpDataTest) {
}
}
// wait for the wal to be cleaned
FLAGS_wal_ttl = 1;
sleep(FLAGS_wal_ttl + 3);
FLAGS_wal_ttl = 60;
LOG(INFO) << "Add learner, we need to catch up data!";
Expand Down

0 comments on commit 7f776c0

Please sign in to comment.