diff --git a/src/kvstore/Listener.cpp b/src/kvstore/Listener.cpp index 3121031e043..523e733c00b 100644 --- a/src/kvstore/Listener.cpp +++ b/src/kvstore/Listener.cpp @@ -147,6 +147,9 @@ void Listener::doApply() { if (isStopped()) { return; } + if (needToCleanupSnapshot()) { + cleanupSnapshot(); + } // todo(doodle): only put is handled, all remove is ignored for now folly::via(executor_.get(), [this] { SCOPE_EXIT { diff --git a/src/kvstore/raftex/SnapshotManager.cpp b/src/kvstore/raftex/SnapshotManager.cpp index 7589e0b2747..0a38eb93e7b 100644 --- a/src/kvstore/raftex/SnapshotManager.cpp +++ b/src/kvstore/raftex/SnapshotManager.cpp @@ -78,11 +78,10 @@ folly::Future>> SnapshotManager::sendSnapshot( } return true; } else { - VLOG(2) << part->idStr_ << "Sending snapshot failed, we don't retry anymore! " - << "The error code is " + VLOG(2) << part->idStr_ << "Sending snapshot failed, the error code is " << apache::thrift::util::enumNameSafe(resp.get_error_code()); - p.setValue(Status::Error("Send snapshot failed!")); - return false; + sleep(1); + continue; } } catch (const std::exception& e) { VLOG(3) << part->idStr_ << "Send snapshot failed, exception " << e.what()