Skip to content

Commit 81bd866

Browse files
authored
Define owners for UpdateForV9 annotations (#113926)
In order to better track the work needed to prepare this branch for the major version upgrade, this commit adds a mandatory `owner` field to all `UpdateForV9` (and `UpdateForV10`) annotations.
1 parent f992116 commit 81bd866

File tree

106 files changed

+210
-163
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+210
-163
lines changed

libs/core/src/main/java/org/elasticsearch/core/RestApiVersion.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public enum RestApiVersion {
2222

2323
V_8(8),
2424

25-
@UpdateForV9 // remove all references to V_7 then delete this annotation
25+
@UpdateForV9(owner = UpdateForV9.Owner.CORE_INFRA) // remove all references to V_7 then delete this annotation
2626
V_7(7);
2727

2828
public final byte major;

libs/core/src/main/java/org/elasticsearch/core/UpdateForV10.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,22 @@
2121
@Retention(RetentionPolicy.SOURCE)
2222
@Target({ ElementType.LOCAL_VARIABLE, ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.METHOD, ElementType.TYPE })
2323
public @interface UpdateForV10 {
24+
enum Owner {
25+
CORE_INFRA,
26+
DATA_MANAGEMENT,
27+
DISTRIBUTED_COORDINATION,
28+
DISTRIBUTED_INDEXING,
29+
ENTERPRISE_SEARCH,
30+
MACHINE_LEARNING,
31+
PROFILING,
32+
SEARCH_ANALYTICS,
33+
SEARCH_FOUNDATIONS,
34+
SEARCH_RELEVANCE,
35+
SECURITY,
36+
}
37+
38+
/**
39+
* The owning team of the task to act on this annotation when the time comes.
40+
*/
41+
Owner owner();
2442
}

libs/core/src/main/java/org/elasticsearch/core/UpdateForV9.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,22 @@
2121
@Retention(RetentionPolicy.SOURCE)
2222
@Target({ ElementType.LOCAL_VARIABLE, ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.METHOD, ElementType.TYPE })
2323
public @interface UpdateForV9 {
24+
enum Owner {
25+
CORE_INFRA,
26+
DATA_MANAGEMENT,
27+
DISTRIBUTED_COORDINATION,
28+
DISTRIBUTED_INDEXING,
29+
ENTERPRISE_SEARCH,
30+
MACHINE_LEARNING,
31+
PROFILING,
32+
SEARCH_ANALYTICS,
33+
SEARCH_FOUNDATIONS,
34+
SEARCH_RELEVANCE,
35+
SECURITY,
36+
}
37+
38+
/**
39+
* The owning team of the task to act on this annotation when the time comes.
40+
*/
41+
Owner owner();
2442
}

modules/ingest-attachment/src/main/java/org/elasticsearch/ingest/attachment/AttachmentProcessor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ public AttachmentProcessor create(
241241
int indexedChars = readIntProperty(TYPE, processorTag, config, "indexed_chars", NUMBER_OF_CHARS_INDEXED);
242242
boolean ignoreMissing = readBooleanProperty(TYPE, processorTag, config, "ignore_missing", false);
243243
String indexedCharsField = readOptionalStringProperty(TYPE, processorTag, config, "indexed_chars_field");
244-
@UpdateForV9 // update the [remove_binary] default to be 'true' assuming enough time has passed. Deprecated in September 2022.
244+
@UpdateForV9(owner = UpdateForV9.Owner.DATA_MANAGEMENT)
245+
// update the [remove_binary] default to be 'true' assuming enough time has passed. Deprecated in September 2022.
245246
Boolean removeBinary = readOptionalBooleanProperty(TYPE, processorTag, config, "remove_binary");
246247
if (removeBinary == null) {
247248
DEPRECATION_LOGGER.warn(

modules/ingest-geoip/qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/ingest/geoip/FullClusterRestartIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
import static org.hamcrest.Matchers.contains;
3636

37-
@UpdateForV9
37+
@UpdateForV9(owner = UpdateForV9.Owner.DATA_MANAGEMENT)
3838
@LuceneTestCase.AwaitsFix(bugUrl = "we need to figure out the index migrations here for 9.0")
3939
public class FullClusterRestartIT extends ParameterizedFullClusterRestartTestCase {
4040

modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/GeoJsonShapeParserTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ public void testParsePolygon() throws IOException, ParseException {
344344
assertGeometryEquals(p, polygonGeoJson, false);
345345
}
346346

347-
@UpdateForV9
347+
@UpdateForV9(owner = UpdateForV9.Owner.SEARCH_ANALYTICS)
348348
@AwaitsFix(bugUrl = "this test is using pre 8.0.0 index versions so needs to be removed or updated")
349349
public void testParse3DPolygon() throws IOException, ParseException {
350350
XContentBuilder polygonGeoJson = XContentFactory.jsonBuilder()

modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/GeoWKTShapeParserTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ public void testParseMixedDimensionPolyWithHole() throws IOException, ParseExcep
303303
assertThat(e, hasToString(containsString("coordinate dimensions do not match")));
304304
}
305305

306-
@UpdateForV9
306+
@UpdateForV9(owner = UpdateForV9.Owner.SEARCH_ANALYTICS)
307307
@AwaitsFix(bugUrl = "this test is using pre 8.0.0 index versions so needs to be removed or updated")
308308
public void testParseMixedDimensionPolyWithHoleStoredZ() throws IOException {
309309
List<Coordinate> shellCoordinates = new ArrayList<>();
@@ -338,7 +338,7 @@ public void testParseMixedDimensionPolyWithHoleStoredZ() throws IOException {
338338
assertThat(e, hasToString(containsString("unable to add coordinate to CoordinateBuilder: coordinate dimensions do not match")));
339339
}
340340

341-
@UpdateForV9
341+
@UpdateForV9(owner = UpdateForV9.Owner.SEARCH_ANALYTICS)
342342
@AwaitsFix(bugUrl = "this test is using pre 8.0.0 index versions so needs to be removed or updated")
343343
public void testParsePolyWithStoredZ() throws IOException {
344344
List<Coordinate> shellCoordinates = new ArrayList<>();
@@ -363,7 +363,7 @@ public void testParsePolyWithStoredZ() throws IOException {
363363
assertEquals(shapeBuilder.numDimensions(), 3);
364364
}
365365

366-
@UpdateForV9
366+
@UpdateForV9(owner = UpdateForV9.Owner.SEARCH_ANALYTICS)
367367
@AwaitsFix(bugUrl = "this test is using pre 8.0.0 index versions so needs to be removed or updated")
368368
public void testParseOpenPolygon() throws IOException {
369369
String openPolygon = "POLYGON ((100 5, 100 10, 90 10, 90 5))";

modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldMapperTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
import static org.mockito.Mockito.when;
5757

5858
@SuppressWarnings("deprecation")
59-
@UpdateForV9
59+
@UpdateForV9(owner = UpdateForV9.Owner.SEARCH_ANALYTICS)
6060
@AwaitsFix(bugUrl = "this is testing legacy functionality so can likely be removed in 9.0")
6161
public class LegacyGeoShapeFieldMapperTests extends MapperTestCase {
6262

modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldTypeTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import java.util.List;
2424
import java.util.Map;
2525

26-
@UpdateForV9
26+
@UpdateForV9(owner = UpdateForV9.Owner.SEARCH_ANALYTICS)
2727
@LuceneTestCase.AwaitsFix(bugUrl = "this is testing legacy functionality so can likely be removed in 9.0")
2828
public class LegacyGeoShapeFieldTypeTests extends FieldTypeTestCase {
2929

qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/upgrades/FullClusterRestartIT.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ public void testClosedIndices() throws Exception {
12071207
closeIndex(index);
12081208
}
12091209

1210-
@UpdateForV9 // This check can be removed (always assume true)
1210+
@UpdateForV9(owner = UpdateForV9.Owner.DISTRIBUTED_INDEXING) // This check can be removed (always assume true)
12111211
var originalClusterSupportsReplicationOfClosedIndices = oldClusterHasFeature(RestTestLegacyFeatures.REPLICATION_OF_CLOSED_INDICES);
12121212

12131213
if (originalClusterSupportsReplicationOfClosedIndices) {
@@ -1608,7 +1608,7 @@ public void testResize() throws Exception {
16081608
@SuppressWarnings("unchecked")
16091609
public void testSystemIndexMetadataIsUpgraded() throws Exception {
16101610

1611-
@UpdateForV9 // assumeTrue can be removed (condition always true)
1611+
@UpdateForV9(owner = UpdateForV9.Owner.CORE_INFRA) // assumeTrue can be removed (condition always true)
16121612
var originalClusterTaskIndexIsSystemIndex = oldClusterHasFeature(RestTestLegacyFeatures.TASK_INDEX_SYSTEM_INDEX);
16131613
assumeTrue(".tasks became a system index in 7.10.0", originalClusterTaskIndexIsSystemIndex);
16141614
final String systemIndexWarning = "this request accesses system indices: [.tasks], but in a future major version, direct "
@@ -1729,7 +1729,7 @@ public void testSystemIndexMetadataIsUpgraded() throws Exception {
17291729
/**
17301730
* This test ensures that soft deletes are enabled a when upgrading a pre-8 cluster to 8.0+
17311731
*/
1732-
@UpdateForV9 // This test can be removed in v9
1732+
@UpdateForV9(owner = UpdateForV9.Owner.DISTRIBUTED_COORDINATION) // This test can be removed in v9
17331733
public void testEnableSoftDeletesOnRestore() throws Exception {
17341734
var originalClusterDidNotEnforceSoftDeletes = oldClusterHasFeature(RestTestLegacyFeatures.SOFT_DELETES_ENFORCED) == false;
17351735

@@ -1842,7 +1842,7 @@ public void testForbidDisableSoftDeletesOnRestore() throws Exception {
18421842
* with true/false as options. This test ensures that the old boolean setting in cluster state is
18431843
* translated properly. This test can be removed in 9.0.
18441844
*/
1845-
@UpdateForV9
1845+
@UpdateForV9(owner = UpdateForV9.Owner.DISTRIBUTED_COORDINATION)
18461846
public void testTransportCompressionSetting() throws IOException {
18471847
var originalClusterBooleanCompressSetting = oldClusterHasFeature(RestTestLegacyFeatures.NEW_TRANSPORT_COMPRESSED_SETTING) == false;
18481848
assumeTrue("the old transport.compress setting existed before 7.14", originalClusterBooleanCompressSetting);

0 commit comments

Comments
 (0)