Skip to content

Commit

Permalink
Fix load snapshots bug when set log level higher than
Browse files Browse the repository at this point in the history
  • Loading branch information
lzydmxy authored and JackyWoo committed Apr 24, 2024
1 parent 3aacc7d commit 5ed2dd4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Service/NuRaftStateMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ NuRaftStateMachine::NuRaftStateMachine(
snap_mgr = cs_new<KeeperSnapshotManager>(snapshot_dir, keep_max_snapshot_count, object_node_size);

/// Load snapshot meta from disk
LOG_INFO(log, "Found {} snapshots from disk, load the latest one", snap_mgr->loadSnapshotMetas());
auto snapshots_count = snap_mgr->loadSnapshotMetas();
LOG_INFO(log, "Found {} snapshots from disk, load the latest one", snapshots_count);
auto last_snapshot = snap_mgr->lastSnapshot();
if (last_snapshot != nullptr)
applySnapshotImpl(*last_snapshot);
Expand Down

0 comments on commit 5ed2dd4

Please sign in to comment.