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
  • Loading branch information
jfreden authored Nov 22, 2024
1 parent 8cfe8f1 commit 546e8e9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 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 @@ -218,31 +218,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 @@ -251,7 +251,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 @@ -56,15 +55,13 @@ public class TransportGetFeatureUpgradeStatusAction extends TransportMasterNodeA
/**
* Once all feature migrations for 8.x -> 9.x have been tested, we can bump this to Version.V_8_0_0
*/
@UpdateForV9(owner = UpdateForV9.Owner.CORE_INFRA)
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(owner = UpdateForV9.Owner.CORE_INFRA) // 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 +146,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 @@ -110,7 +110,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 546e8e9

Please sign in to comment.