mirror of
https://github.com/typesense/typesense.git
synced 2025-05-18 20:52:50 +08:00
Flush analytics store before snapshot.
This commit is contained in:
parent
b0359000b1
commit
cc1588ecfa
@ -507,7 +507,7 @@ void AnalyticsManager::run(ReplicationState* raft_server) {
|
||||
std::unique_lock lk(mutex);
|
||||
cv.wait_for(lk, std::chrono::seconds(QUERY_COMPACTION_INTERVAL_S), [&] { return quit.load(); });
|
||||
|
||||
//LOG(INFO) << "QuerySuggestions::run";
|
||||
//LOG(INFO) << "AnalyticsManager::run";
|
||||
|
||||
if(quit) {
|
||||
lk.unlock();
|
||||
|
@ -579,6 +579,9 @@ void ReplicationState::on_snapshot_save(braft::SnapshotWriter* writer, braft::Cl
|
||||
}
|
||||
|
||||
if(analytics_store) {
|
||||
// to ensure that in-memory table is sent to disk (we don't use WAL)
|
||||
analytics_store->flush();
|
||||
|
||||
rocksdb::Checkpoint* checkpoint2 = nullptr;
|
||||
status = analytics_store->create_check_point(&checkpoint2, analytics_db_snapshot_path);
|
||||
std::unique_ptr<rocksdb::Checkpoint> checkpoint_guard(checkpoint2);
|
||||
|
Loading…
x
Reference in New Issue
Block a user