From 3420d77de3f5d595b003ec1486e31f8c94d43af7 Mon Sep 17 00:00:00 2001 From: heng Date: Fri, 31 Jul 2020 13:54:03 +0800 Subject: [PATCH] Fix bug about catchup --- src/kvstore/raftex/RaftPart.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/kvstore/raftex/RaftPart.cpp b/src/kvstore/raftex/RaftPart.cpp index f670c392dc1..5699625fbe4 100644 --- a/src/kvstore/raftex/RaftPart.cpp +++ b/src/kvstore/raftex/RaftPart.cpp @@ -1837,7 +1837,8 @@ AppendLogResult RaftPart::isCatchedUp(const HostAddr& peer) { } for (auto& host : hosts_) { if (host->addr_ == peer) { - if (host->followerCommittedLogId_ < wal_->firstLogId()) { + if (host->followerCommittedLogId_ == 0 + || host->followerCommittedLogId_ < wal_->firstLogId()) { LOG(INFO) << idStr_ << "The committed log id of peer is " << host->followerCommittedLogId_ << ", which is invalid or less than my first wal log id";