Skip to content

Commit 1accd8a

Browse files
committed
Merge 8.x_backport index versions
Per #125610 we only need 1 index version for the 8.x offset encoding implementations (since there haven't been any 8.x releases).
1 parent 789ad92 commit 1accd8a

File tree

6 files changed

+12
-17
lines changed

6 files changed

+12
-17
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,7 @@ private static Version parseUnchecked(String version) {
135135
public static final IndexVersion INFERENCE_METADATA_FIELDS_BACKPORT = def(8_524_0_00, parseUnchecked("9.12.1"));
136136
public static final IndexVersion LOGSB_OPTIONAL_SORTING_ON_HOST_NAME_BACKPORT = def(8_525_0_00, parseUnchecked("9.12.1"));
137137
public static final IndexVersion USE_SYNTHETIC_SOURCE_FOR_RECOVERY_BY_DEFAULT_BACKPORT = def(8_526_0_00, parseUnchecked("9.12.1"));
138-
public static final IndexVersion SYNTHETIC_SOURCE_STORE_ARRAYS_NATIVELY_KEYWORD_BACKPORT_8_X = def(8_527_0_00, Version.LUCENE_9_12_1);
139-
public static final IndexVersion SYNTHETIC_SOURCE_STORE_ARRAYS_NATIVELY_NUMBER_BACKPORT_8_X = def(8_528_0_00, Version.LUCENE_9_12_1);
140-
public static final IndexVersion SYNTHETIC_SOURCE_STORE_ARRAYS_NATIVELY_BOOLEAN_BACKPORT_8_X = def(8_529_0_00, Version.LUCENE_9_12_1);
138+
public static final IndexVersion SYNTHETIC_SOURCE_STORE_ARRAYS_NATIVELY_BACKPORT_8_X = def(8_527_0_00, Version.LUCENE_9_12_1);
141139
public static final IndexVersion UPGRADE_TO_LUCENE_10_0_0 = def(9_000_0_00, Version.LUCENE_10_0_0);
142140
public static final IndexVersion LOGSDB_DEFAULT_IGNORE_DYNAMIC_BEYOND_LIMIT = def(9_001_0_00, Version.LUCENE_10_0_0);
143141
public static final IndexVersion TIME_BASED_K_ORDERED_DOC_ID = def(9_002_0_00, Version.LUCENE_10_0_0);

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,7 @@ public BooleanFieldMapper build(MapperBuilderContext context) {
186186
stored.getValue(),
187187
this,
188188
indexCreatedVersion,
189-
IndexVersions.SYNTHETIC_SOURCE_STORE_ARRAYS_NATIVELY_BOOLEAN,
190-
IndexVersions.SYNTHETIC_SOURCE_STORE_ARRAYS_NATIVELY_BOOLEAN_BACKPORT_8_X
189+
IndexVersions.SYNTHETIC_SOURCE_STORE_ARRAYS_NATIVELY_BOOLEAN
191190
);
192191
return new BooleanFieldMapper(
193192
leafName(),

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ static String getOffsetsFieldName(
9090
boolean isStored,
9191
FieldMapper.Builder fieldMapperBuilder,
9292
IndexVersion indexCreatedVersion,
93-
IndexVersion minSupportedVersionMain,
94-
IndexVersion minSupportedVersion8x
93+
IndexVersion minSupportedVersionMain
9594
) {
9695
var sourceKeepMode = fieldMapperBuilder.sourceKeepMode.orElse(indexSourceKeepMode);
9796
if (context.isSourceSynthetic()
@@ -101,7 +100,7 @@ static String getOffsetsFieldName(
101100
&& context.isInNestedContext() == false
102101
&& fieldMapperBuilder.copyTo.copyToFields().isEmpty()
103102
&& fieldMapperBuilder.multiFieldsBuilder.hasMultiFields() == false
104-
&& indexVersionSupportStoringArraysNatively(indexCreatedVersion, minSupportedVersionMain, minSupportedVersion8x)) {
103+
&& indexVersionSupportStoringArraysNatively(indexCreatedVersion, minSupportedVersionMain)) {
105104
// Skip stored, we will be synthesizing from stored fields, no point to keep track of the offsets
106105
// Skip copy_to and multi fields, supporting that requires more work. However, copy_to usage is rare in metrics and
107106
// logging use cases
@@ -116,11 +115,13 @@ && indexVersionSupportStoringArraysNatively(indexCreatedVersion, minSupportedVer
116115

117116
private static boolean indexVersionSupportStoringArraysNatively(
118117
IndexVersion indexCreatedVersion,
119-
IndexVersion minSupportedVersionMain,
120-
IndexVersion minSupportedVersion8x
118+
IndexVersion minSupportedVersionMain
121119
) {
122120
return indexCreatedVersion.onOrAfter(minSupportedVersionMain)
123-
|| indexCreatedVersion.between(minSupportedVersion8x, IndexVersions.UPGRADE_TO_LUCENE_10_0_0);
121+
|| indexCreatedVersion.between(
122+
IndexVersions.SYNTHETIC_SOURCE_STORE_ARRAYS_NATIVELY_BACKPORT_8_X,
123+
IndexVersions.UPGRADE_TO_LUCENE_10_0_0
124+
);
124125
}
125126

126127
private static class Offsets {

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ public IpFieldMapper build(MapperBuilderContext context) {
201201
stored.getValue(),
202202
this,
203203
indexCreatedVersion,
204-
IndexVersions.SYNTHETIC_SOURCE_STORE_ARRAYS_NATIVELY_IP,
205-
IndexVersions.SYNTHETIC_SOURCE_STORE_ARRAYS_NATIVELY_KEYWORD_BACKPORT_8_X
204+
IndexVersions.SYNTHETIC_SOURCE_STORE_ARRAYS_NATIVELY_IP
206205
);
207206
return new IpFieldMapper(
208207
leafName(),

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,7 @@ public KeywordFieldMapper build(MapperBuilderContext context) {
446446
stored.getValue(),
447447
this,
448448
indexCreatedVersion,
449-
IndexVersions.SYNTHETIC_SOURCE_STORE_ARRAYS_NATIVELY_KEYWORD,
450-
IndexVersions.SYNTHETIC_SOURCE_STORE_ARRAYS_NATIVELY_KEYWORD_BACKPORT_8_X
449+
IndexVersions.SYNTHETIC_SOURCE_STORE_ARRAYS_NATIVELY_KEYWORD
451450
);
452451
return new KeywordFieldMapper(
453452
leafName(),

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,7 @@ public NumberFieldMapper build(MapperBuilderContext context) {
297297
stored.getValue(),
298298
this,
299299
indexCreatedVersion,
300-
IndexVersions.SYNTHETIC_SOURCE_STORE_ARRAYS_NATIVELY_NUMBER,
301-
IndexVersions.SYNTHETIC_SOURCE_STORE_ARRAYS_NATIVELY_NUMBER_BACKPORT_8_X
300+
IndexVersions.SYNTHETIC_SOURCE_STORE_ARRAYS_NATIVELY_NUMBER
302301
);
303302
return new NumberFieldMapper(leafName(), ft, builderParams(this, context), context.isSourceSynthetic(), this, offsetsFieldName);
304303
}

0 commit comments

Comments
 (0)