Skip to content

Commit

Permalink
Bump major version for feature migration system indices (elastic#117243)
Browse files Browse the repository at this point in the history
* Bump major version for feature upgrade system indices

(cherry picked from commit 546e8e9)

# Conflicts:
#	server/src/main/java/org/elasticsearch/action/admin/cluster/migration/TransportGetFeatureUpgradeStatusAction.java
  • Loading branch information
jfreden committed Nov 22, 2024
1 parent a3de906 commit ff77068
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
5 changes: 5 additions & 0 deletions docs/changelog/117243.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 117243
summary: Bump major version for feature migration system indices
area: Infra/Core
type: upgrade
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -208,31 +208,31 @@ public void testMigrateInternalManagedSystemIndex() throws Exception {

assertIndexHasCorrectProperties(
finalMetadata,
".int-man-old-reindexed-for-8",
".int-man-old-reindexed-for-9",
INTERNAL_MANAGED_FLAG_VALUE,
true,
true,
Arrays.asList(".int-man-old", ".internal-managed-alias")
);
assertIndexHasCorrectProperties(
finalMetadata,
".int-unman-old-reindexed-for-8",
".int-unman-old-reindexed-for-9",
INTERNAL_UNMANAGED_FLAG_VALUE,
false,
true,
Collections.singletonList(".int-unman-old")
);
assertIndexHasCorrectProperties(
finalMetadata,
".ext-man-old-reindexed-for-8",
".ext-man-old-reindexed-for-9",
EXTERNAL_MANAGED_FLAG_VALUE,
true,
false,
Arrays.asList(".ext-man-old", ".external-managed-alias")
);
assertIndexHasCorrectProperties(
finalMetadata,
".ext-unman-old-reindexed-for-8",
".ext-unman-old-reindexed-for-9",
EXTERNAL_UNMANAGED_FLAG_VALUE,
false,
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,31 +219,31 @@ public void testMultipleFeatureMigration() throws Exception {
// Finally, verify that all the indices exist and have the properties we expect.
assertIndexHasCorrectProperties(
finalMetadata,
".int-man-old-reindexed-for-8",
".int-man-old-reindexed-for-9",
INTERNAL_MANAGED_FLAG_VALUE,
true,
true,
Arrays.asList(".int-man-old", ".internal-managed-alias")
);
assertIndexHasCorrectProperties(
finalMetadata,
".int-unman-old-reindexed-for-8",
".int-unman-old-reindexed-for-9",
INTERNAL_UNMANAGED_FLAG_VALUE,
false,
true,
Collections.singletonList(".int-unman-old")
);
assertIndexHasCorrectProperties(
finalMetadata,
".ext-man-old-reindexed-for-8",
".ext-man-old-reindexed-for-9",
EXTERNAL_MANAGED_FLAG_VALUE,
true,
false,
Arrays.asList(".ext-man-old", ".external-managed-alias")
);
assertIndexHasCorrectProperties(
finalMetadata,
".ext-unman-old-reindexed-for-8",
".ext-unman-old-reindexed-for-9",
EXTERNAL_UNMANAGED_FLAG_VALUE,
false,
false,
Expand All @@ -252,7 +252,7 @@ public void testMultipleFeatureMigration() throws Exception {

assertIndexHasCorrectProperties(
finalMetadata,
".second-int-man-old-reindexed-for-8",
".second-int-man-old-reindexed-for-9",
SECOND_FEATURE_IDX_FLAG_VALUE,
true,
true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.util.concurrent.EsExecutors;
import org.elasticsearch.core.UpdateForV9;
import org.elasticsearch.index.IndexVersion;
import org.elasticsearch.index.IndexVersions;
import org.elasticsearch.indices.SystemIndices;
Expand Down Expand Up @@ -53,18 +52,13 @@ public class TransportGetFeatureUpgradeStatusAction extends TransportMasterNodeA
GetFeatureUpgradeStatusRequest,
GetFeatureUpgradeStatusResponse> {

/**
* Once all feature migrations for 8.x -> 9.x have been tested, we can bump this to Version.V_8_0_0
*/
@UpdateForV9
public static final Version NO_UPGRADE_REQUIRED_VERSION = Version.V_7_0_0;
public static final IndexVersion NO_UPGRADE_REQUIRED_INDEX_VERSION = IndexVersions.V_7_0_0;
public static final Version NO_UPGRADE_REQUIRED_VERSION = Version.V_8_0_0;
public static final IndexVersion NO_UPGRADE_REQUIRED_INDEX_VERSION = IndexVersions.V_8_0_0;

private final SystemIndices systemIndices;
PersistentTasksService persistentTasksService;

@Inject
@UpdateForV9 // Once we begin working on 9.x, we need to update our migration classes
public TransportGetFeatureUpgradeStatusAction(
TransportService transportService,
ThreadPool threadPool,
Expand Down Expand Up @@ -149,7 +143,6 @@ static GetFeatureUpgradeStatusResponse.FeatureUpgradeStatus getFeatureUpgradeSta
.map(idxInfo -> ERROR)
.map(idxStatus -> GetFeatureUpgradeStatusResponse.UpgradeStatus.combine(idxStatus, initialStatus))
.orElse(initialStatus);

return new GetFeatureUpgradeStatusResponse.FeatureUpgradeStatus(featureName, minimumVersion, status, indexInfos);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
public class SystemIndices {
public static final String SYSTEM_INDEX_ACCESS_CONTROL_HEADER_KEY = "_system_index_access_allowed";
public static final String EXTERNAL_SYSTEM_INDEX_ACCESS_CONTROL_HEADER_KEY = "_external_system_index_access_origin";
public static final String UPGRADED_INDEX_SUFFIX = "-reindexed-for-8";
public static final String UPGRADED_INDEX_SUFFIX = "-reindexed-for-9";

private static final Automaton EMPTY = Automata.makeEmpty();

Expand Down

0 comments on commit ff77068

Please sign in to comment.