diff --git a/src/chunkserver/copyset_node.h b/src/chunkserver/copyset_node.h index d51f266b67..594d4a77b7 100755 --- a/src/chunkserver/copyset_node.h +++ b/src/chunkserver/copyset_node.h @@ -417,6 +417,9 @@ class CopysetNode : public braft::StateMachine, ::braft::Closure *done); void ShipToSync(ChunkID chunkId) { + if (enableOdsyncWhenOpenChunkFile_) { + return; + } curve::common::LockGuard lg(chunkIdsLock_); chunkIdsToSync_.push_back(chunkId); } diff --git a/src/chunkserver/raftlog/curve_segment.cpp b/src/chunkserver/raftlog/curve_segment.cpp index afacec27f7..c4298357a6 100644 --- a/src/chunkserver/raftlog/curve_segment.cpp +++ b/src/chunkserver/raftlog/curve_segment.cpp @@ -217,6 +217,8 @@ int CurveSegment::load(braft::ConfigurationManager* configuration_manager) { if (_is_open) { _last_index = actual_last_index; + } else { + _offset_and_term.shrink_to_fit(); } // seek to end, for opening segment