File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
server/src/main/java/org/opensearch/indices/replication/common Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,9 @@ public CopyState(IndexShard shard) throws IOException {
4949 SegmentInfos segmentInfosSnapshot = segmentInfos .clone ();
5050 Map <String , String > userData = segmentInfosSnapshot .getUserData ();
5151 long maxSeqNo = Long .parseLong (userData .getOrDefault (SequenceNumbers .MAX_SEQ_NO , "-1" ));
52+ // In the scenario of vanilla segment replication. We need to ensure that after the primary promotion,
53+ // the SegmentInfos#version of the primary shard is always greater than or equal to that of the replicas.
54+ // At the same time, it is also necessary to ensure that there is no risk of data loss.
5255 userData .put (SequenceNumbers .MAX_SEQ_NO , Long .toString (Math .min (maxSeqNo , lastRefreshedCheckpoint )));
5356 segmentInfosSnapshot .setUserData (userData , false );
5457
You can’t perform that action at this time.
0 commit comments