Skip to content

Commit 939575a

Browse files
committed
Add comments
Signed-off-by: guojialiang <[email protected]>
1 parent 9231a7f commit 939575a

File tree

1 file changed

+3
-3
lines changed
  • server/src/main/java/org/opensearch/indices/replication/common

1 file changed

+3
-3
lines changed

server/src/main/java/org/opensearch/indices/replication/common/CopyState.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +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.
52+
// In the scenario of primary promotion. We need to ensure that the SegmentInfos#version of the new primary shard
53+
// is greater than or equal to that of the replicas, and also need to ensure that the local_checkpoint of the new
54+
// primary shard is less than or equal to the checkpoint of the Lucene commit.
5555
userData.put(SequenceNumbers.MAX_SEQ_NO, Long.toString(Math.min(maxSeqNo, lastRefreshedCheckpoint)));
5656
segmentInfosSnapshot.setUserData(userData, false);
5757

0 commit comments

Comments
 (0)