File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed
server/src/main/java/org/opensearch
indices/replication/common Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -269,10 +269,7 @@ public void onAfterTranslogSync() {
269269
270270 @ Override
271271 public void onAfterTranslogRecovery () {
272- // In the scenario of vanilla segment replication, the force parameter is used to ensure that the
273- // SegmentInfos#version of the primary shard is greater than or equal to that of the replicas.
274- boolean isForceFlush = engineConfig .getIndexSettings ().isSegRepLocalEnabled ();
275- flush (isForceFlush , true );
272+ flush (false , true );
276273 translogManager .trimUnreferencedTranslogFiles ();
277274 }
278275
Original file line number Diff line number Diff line change 2323import java .io .UncheckedIOException ;
2424import java .util .Map ;
2525
26- import static org .opensearch .index .seqno .SequenceNumbers .LOCAL_CHECKPOINT_KEY ;
27-
2826/**
2927 * An Opensearch-specific version of Lucene's CopyState class that
3028 * holds incRef'd file level details for one point-in-time segment infos.
@@ -50,8 +48,8 @@ public CopyState(IndexShard shard) throws IOException {
5048
5149 SegmentInfos segmentInfosSnapshot = segmentInfos .clone ();
5250 Map <String , String > userData = segmentInfosSnapshot .getUserData ();
53- userData . put ( LOCAL_CHECKPOINT_KEY , String . valueOf ( lastRefreshedCheckpoint ));
54- userData .put (SequenceNumbers .MAX_SEQ_NO , Long .toString (lastRefreshedCheckpoint ));
51+ long maxSeqNo = Long . parseLong ( userData . get ( SequenceNumbers . MAX_SEQ_NO ));
52+ userData .put (SequenceNumbers .MAX_SEQ_NO , Long .toString (Math . min ( maxSeqNo , lastRefreshedCheckpoint ) ));
5553 segmentInfosSnapshot .setUserData (userData , false );
5654
5755 ByteBuffersDataOutput buffer = new ByteBuffersDataOutput ();
You can’t perform that action at this time.
0 commit comments