Skip to content

Commit 0f5eb0c

Browse files
authored
Adjust deprecate index versions (#117523)
Adjust the deprecation index check to support the backport version in 8.x. Relates #117183
1 parent e5b9b7e commit 0f5eb0c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

server/src/main/java/org/elasticsearch/index/IndexVersions.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ private static Version parseUnchecked(String version) {
131131
public static final IndexVersion ADD_ROLE_MAPPING_CLEANUP_MIGRATION = def(8_518_00_0, Version.LUCENE_9_12_0);
132132
public static final IndexVersion LOGSDB_DEFAULT_IGNORE_DYNAMIC_BEYOND_LIMIT_BACKPORT = def(8_519_00_0, Version.LUCENE_9_12_0);
133133
public static final IndexVersion TIME_BASED_K_ORDERED_DOC_ID_BACKPORT = def(8_520_00_0, Version.LUCENE_9_12_0);
134+
public static final IndexVersion V8_DEPRECATE_SOURCE_MODE_MAPPER = def(8_521_00_0, Version.LUCENE_9_12_0);
134135
public static final IndexVersion UPGRADE_TO_LUCENE_10_0_0 = def(9_000_00_0, Version.LUCENE_10_0_0);
135136
public static final IndexVersion LOGSDB_DEFAULT_IGNORE_DYNAMIC_BEYOND_LIMIT = def(9_001_00_0, Version.LUCENE_10_0_0);
136137
public static final IndexVersion TIME_BASED_K_ORDERED_DOC_ID = def(9_002_00_0, Version.LUCENE_10_0_0);

server/src/main/java/org/elasticsearch/index/mapper/SourceFieldMapper.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,7 @@ public boolean isStored() {
484484
}
485485

486486
public static boolean onOrAfterDeprecateModeVersion(IndexVersion version) {
487-
return version.onOrAfter(IndexVersions.DEPRECATE_SOURCE_MODE_MAPPER);
488-
// Adjust versions after backporting.
489-
// || version.between(IndexVersions.BACKPORT_DEPRECATE_SOURCE_MODE_MAPPER, IndexVersions.UPGRADE_TO_LUCENE_10_0_0);
487+
return version.onOrAfter(IndexVersions.DEPRECATE_SOURCE_MODE_MAPPER)
488+
|| version.between(IndexVersions.V8_DEPRECATE_SOURCE_MODE_MAPPER, IndexVersions.UPGRADE_TO_LUCENE_10_0_0);
490489
}
491490
}

0 commit comments

Comments
 (0)