From 7087792ce48e38495827bdd12c726136cbb503e1 Mon Sep 17 00:00:00 2001 From: lhsoft Date: Sat, 10 Sep 2022 09:31:13 +0800 Subject: [PATCH] Fix raft_sync bug when segment is closed --- src/braft/log.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/braft/log.cpp b/src/braft/log.cpp index b58b04a9..e1c9d2f7 100644 --- a/src/braft/log.cpp +++ b/src/braft/log.cpp @@ -540,7 +540,7 @@ int Segment::close(bool will_sync) { << " path: " << new_path; int ret = 0; if (_last_index > _first_index) { - if (FLAGS_raft_sync_segments && will_sync) { + if ((FLAGS_raft_sync || FLAGS_raft_sync_segments) && will_sync) { ret = raft_fsync(_fd); } }