Skip to content

Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch ⚡ 🔍 ✨ Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences

Set min snapshot index gap to 1.

kishorenc6593d959ecdc
diff --git a/include/raft_server.h b/include/raft_server.h
index e2dc6561..f5bc9354 100644
--- a/include/raft_server.h
+++ b/include/raft_server.h
@@ -209,7 +209,7 @@ private:
}
void on_start_following(const ::braft::LeaderChangeContext& ctx) {
- LOG(INFO) << "Node start following " << ctx;
+ LOG(INFO) << "Node starts following " << ctx;
init_readiness_count++;
}
diff --git a/src/raft_server.cpp b/src/raft_server.cpp
index b501dcf4..8ee297a6 100644
--- a/src/raft_server.cpp
+++ b/src/raft_server.cpp
@@ -34,7 +34,7 @@ int ReplicationState::start(const butil::EndPoint & peering_endpoint, const int
}
// do snapshot only when the gap between applied index and last snapshot index is >= this number
- braft::FLAGS_raft_do_snapshot_min_index_gap = 20;
+ braft::FLAGS_raft_do_snapshot_min_index_gap = 1;
node_options.election_timeout_ms = election_timeout_ms;
node_options.fsm = this;
@@ -327,6 +327,7 @@ void* ReplicationState::save_snapshot(void* arg) {
}
void ReplicationState::on_snapshot_save(braft::SnapshotWriter* writer, braft::Closure* done) {
+ LOG(INFO) << "on_snapshot_save";
// Start a new bthread to avoid blocking StateMachine since it could be slow to write data to disk
SnapshotArg* arg = new SnapshotArg;
arg->db = store->_get_db_unsafe();