diff --git a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/IngestGeoIpPlugin.java b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/IngestGeoIpPlugin.java index 3107f0bed55e8..a09069dcf438f 100644 --- a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/IngestGeoIpPlugin.java +++ b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/IngestGeoIpPlugin.java @@ -275,7 +275,6 @@ public Collection getSystemIndexDescriptors(Settings sett .build() ) .setOrigin(INGEST_ORIGIN) - .setVersionMetaKey("version") .setPrimaryIndex(DATABASES_INDEX) .setNetNew() .build(); diff --git a/modules/reindex/src/internalClusterTest/java/org/elasticsearch/migration/AbstractFeatureMigrationIntegTest.java b/modules/reindex/src/internalClusterTest/java/org/elasticsearch/migration/AbstractFeatureMigrationIntegTest.java index 4b21db497ead7..ea1c8ade00abe 100644 --- a/modules/reindex/src/internalClusterTest/java/org/elasticsearch/migration/AbstractFeatureMigrationIntegTest.java +++ b/modules/reindex/src/internalClusterTest/java/org/elasticsearch/migration/AbstractFeatureMigrationIntegTest.java @@ -78,7 +78,6 @@ public abstract class AbstractFeatureMigrationIntegTest extends ESIntegTestCase .setType(SystemIndexDescriptor.Type.EXTERNAL_UNMANAGED) .setOrigin(ORIGIN) .setAllowedElasticProductOrigins(Collections.singletonList(ORIGIN)) - .setMinimumNodeVersion(NEEDS_UPGRADE_VERSION) .setPriorSystemIndexDescriptors(Collections.emptyList()) .build(); static final SystemIndexDescriptor INTERNAL_UNMANAGED = SystemIndexDescriptor.builder() @@ -86,7 +85,6 @@ public abstract class AbstractFeatureMigrationIntegTest extends ESIntegTestCase .setType(SystemIndexDescriptor.Type.INTERNAL_UNMANAGED) .setOrigin(ORIGIN) .setAllowedElasticProductOrigins(Collections.emptyList()) - .setMinimumNodeVersion(NEEDS_UPGRADE_VERSION) .setPriorSystemIndexDescriptors(Collections.emptyList()) .build(); @@ -98,9 +96,7 @@ public abstract class AbstractFeatureMigrationIntegTest extends ESIntegTestCase .setSettings(createSettings(NEEDS_UPGRADE_INDEX_VERSION, INTERNAL_MANAGED_FLAG_VALUE)) .setMappings(createMapping(true, true)) .setOrigin(ORIGIN) - .setVersionMetaKey(VERSION_META_KEY) .setAllowedElasticProductOrigins(Collections.emptyList()) - .setMinimumNodeVersion(NEEDS_UPGRADE_VERSION) .setPriorSystemIndexDescriptors(Collections.emptyList()) .build(); static final int INTERNAL_UNMANAGED_FLAG_VALUE = 2; @@ -113,9 +109,7 @@ public abstract class AbstractFeatureMigrationIntegTest extends ESIntegTestCase .setSettings(createSettings(NEEDS_UPGRADE_INDEX_VERSION, EXTERNAL_MANAGED_FLAG_VALUE)) .setMappings(createMapping(true, false)) .setOrigin(ORIGIN) - .setVersionMetaKey(VERSION_META_KEY) .setAllowedElasticProductOrigins(Collections.singletonList(ORIGIN)) - .setMinimumNodeVersion(NEEDS_UPGRADE_VERSION) .setPriorSystemIndexDescriptors(Collections.emptyList()) .build(); static final int EXTERNAL_UNMANAGED_FLAG_VALUE = 4; @@ -128,7 +122,6 @@ public abstract class AbstractFeatureMigrationIntegTest extends ESIntegTestCase .setType(SystemIndexDescriptor.Type.EXTERNAL_UNMANAGED) .setAllowedElasticProductOrigins(Collections.emptyList()) .setAllowedElasticProductOrigins(Collections.singletonList(ORIGIN)) - .setMinimumNodeVersion(NEEDS_UPGRADE_VERSION) .setPriorSystemIndexDescriptors(Collections.emptyList()) .setAllowsTemplates() .build(); diff --git a/modules/reindex/src/internalClusterTest/java/org/elasticsearch/migration/MultiFeatureMigrationIT.java b/modules/reindex/src/internalClusterTest/java/org/elasticsearch/migration/MultiFeatureMigrationIT.java index 4fcd061f421aa..1ee5519593569 100644 --- a/modules/reindex/src/internalClusterTest/java/org/elasticsearch/migration/MultiFeatureMigrationIT.java +++ b/modules/reindex/src/internalClusterTest/java/org/elasticsearch/migration/MultiFeatureMigrationIT.java @@ -10,7 +10,6 @@ package org.elasticsearch.migration; import org.apache.lucene.util.SetOnce; -import org.elasticsearch.Version; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusAction; import org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusRequest; @@ -268,9 +267,7 @@ public void testMultipleFeatureMigration() throws Exception { .setSettings(createSettings(IndexVersions.MINIMUM_COMPATIBLE, 0)) .setMappings(createMapping(true, true)) .setOrigin(ORIGIN) - .setVersionMetaKey(VERSION_META_KEY) .setAllowedElasticProductOrigins(Collections.emptyList()) - .setMinimumNodeVersion(Version.CURRENT.minimumCompatibilityVersion()) .setPriorSystemIndexDescriptors(Collections.emptyList()) .build(); diff --git a/qa/smoke-test-http/src/javaRestTest/java/org/elasticsearch/http/SystemIndexRestIT.java b/qa/smoke-test-http/src/javaRestTest/java/org/elasticsearch/http/SystemIndexRestIT.java index 2e48860e613ee..e37ea125ac070 100644 --- a/qa/smoke-test-http/src/javaRestTest/java/org/elasticsearch/http/SystemIndexRestIT.java +++ b/qa/smoke-test-http/src/javaRestTest/java/org/elasticsearch/http/SystemIndexRestIT.java @@ -196,7 +196,6 @@ public Collection getSystemIndexDescriptors(Settings sett .setPrimaryIndex(SYSTEM_INDEX_NAME) .setDescription("Test system index") .setOrigin(getClass().getName()) - .setVersionMetaKey("version") .setMappings(builder) .setSettings(SETTINGS) .setType(Type.INTERNAL_MANAGED) diff --git a/qa/system-indices/src/main/java/org/elasticsearch/system/indices/SystemIndicesQA.java b/qa/system-indices/src/main/java/org/elasticsearch/system/indices/SystemIndicesQA.java index 57b0908508bb3..6e15e40efa69a 100644 --- a/qa/system-indices/src/main/java/org/elasticsearch/system/indices/SystemIndicesQA.java +++ b/qa/system-indices/src/main/java/org/elasticsearch/system/indices/SystemIndicesQA.java @@ -77,7 +77,6 @@ public Collection getSystemIndexDescriptors(Settings sett .build() ) .setOrigin(TASKS_ORIGIN) - .setVersionMetaKey("version") .setPrimaryIndex(".net-new-system-index-primary") .build(), SystemIndexDescriptor.builder() @@ -99,7 +98,6 @@ public Collection getSystemIndexDescriptors(Settings sett .build() ) .setOrigin(TASKS_ORIGIN) - .setVersionMetaKey("version") .setPrimaryIndex(".internal-managed-index-primary") .setAliasName(".internal-managed-alias") .build() diff --git a/server/src/internalClusterTest/java/org/elasticsearch/aliases/NetNewSystemIndexAliasIT.java b/server/src/internalClusterTest/java/org/elasticsearch/aliases/NetNewSystemIndexAliasIT.java index 27392fefbf4ca..cf54bc50398c4 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/aliases/NetNewSystemIndexAliasIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/aliases/NetNewSystemIndexAliasIT.java @@ -89,7 +89,6 @@ public Collection getSystemIndexDescriptors(Settings sett .setPrimaryIndex(SYSTEM_INDEX_NAME) .setDescription("Test system index") .setOrigin(getClass().getName()) - .setVersionMetaKey("version") .setMappings(builder) .setSettings(SETTINGS) .setType(SystemIndexDescriptor.Type.INTERNAL_MANAGED) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/TestSystemIndexDescriptor.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/TestSystemIndexDescriptor.java index cc05bb4c82ceb..487bbf7c9a4be 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/indices/TestSystemIndexDescriptor.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/TestSystemIndexDescriptor.java @@ -9,7 +9,6 @@ package org.elasticsearch.indices; -import org.elasticsearch.Build; import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.Strings; @@ -51,9 +50,7 @@ public class TestSystemIndexDescriptor extends SystemIndexDescriptor { SETTINGS, INDEX_NAME, 0, - "version", "stack", - null, Type.INTERNAL_MANAGED, List.of(), List.of(), @@ -72,9 +69,7 @@ public class TestSystemIndexDescriptor extends SystemIndexDescriptor { SETTINGS, name, 0, - "version", "stack", - Version.fromString(Build.current().minWireCompatVersion()), Type.INTERNAL_MANAGED, List.of(), List.of(), diff --git a/server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java b/server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java index f3456870114f5..8b9610a52cc3d 100644 --- a/server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java +++ b/server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java @@ -13,7 +13,6 @@ import org.apache.lucene.util.automaton.CharacterRunAutomaton; import org.apache.lucene.util.automaton.Operations; import org.apache.lucene.util.automaton.RegExp; -import org.elasticsearch.Version; import org.elasticsearch.action.admin.indices.create.AutoCreateAction; import org.elasticsearch.action.admin.indices.create.TransportCreateIndexAction; import org.elasticsearch.cluster.metadata.IndexMetadata; @@ -36,7 +35,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.Locale; import java.util.Map; import java.util.Objects; import java.util.Set; @@ -141,25 +139,12 @@ public class SystemIndexDescriptor implements IndexPatternMatcher, Comparable_meta in the index mappings - * that contains the index's mappings' {@link Version}. We need to read and write this field for - * backwards compatibility. - */ - private final String mappingsNodeVersionMetaKey; - /** The version meta key for the integer system index mapping version */ public static final String VERSION_META_KEY = "managed_index_mappings_version"; /** For internally-managed indices, specifies the origin to use when creating or updating the index */ private final String origin; - /** The minimum cluster node version required for this descriptor */ - private final Version minimumNodeVersion; - - /** Legacy mapping version from the descriptor */ - private final Version mappingsNodeVersion; - /** Mapping version from the descriptor */ private final MappingsVersion mappingsVersion; @@ -209,11 +194,8 @@ public class SystemIndexDescriptor implements IndexPatternMatcher, Comparable_meta where a version can be found, which indicates the - * Elasticsearch version when the index was created. * @param origin the client origin to use when creating this index. Internal system indices must not provide an origin, while external * system indices must do so. - * @param minimumNodeVersion the minimum cluster node version required for this descriptor * @param type The {@link Type} of system index * @param allowedElasticProductOrigins A list of allowed origin values that should be allowed access in the case of external system * indices @@ -229,9 +211,7 @@ protected SystemIndexDescriptor( Settings settings, String aliasName, int indexFormat, - String mappingsNodeVersionMetaKey, String origin, - @Deprecated Version minimumNodeVersion, Type type, List allowedElasticProductOrigins, List priorSystemIndexDescriptors, @@ -282,12 +262,10 @@ protected SystemIndexDescriptor( Objects.requireNonNull(settings, "Must supply settings for a managed system index"); Strings.requireNonEmpty(mappings, "Must supply mappings for a managed system index"); Strings.requireNonEmpty(primaryIndex, "Must supply primaryIndex for a managed system index"); - Strings.requireNonEmpty(mappingsNodeVersionMetaKey, "Must supply nodeVersionMetaKey for a managed system index"); Strings.requireNonEmpty(origin, "Must supply origin for a managed system index"); if (settings.getAsInt(IndexMetadata.INDEX_FORMAT_SETTING.getKey(), 0) != indexFormat) { throw new IllegalArgumentException("Descriptor index format does not match index format in managed settings"); } - this.mappingsNodeVersion = bestEffortExtractNodeVersionFromMappings(mappings, mappingsNodeVersionMetaKey); this.mappingsVersion = extractVersionFromMappings(mappings); assert mappingsVersion.version >= 0 : "The mappings version must not be negative"; @@ -295,8 +273,6 @@ protected SystemIndexDescriptor( assert Objects.isNull(settings) : "Unmanaged index descriptors should not have settings"; assert Objects.isNull(mappings) : "Unmanaged index descriptors should not have mappings"; assert Objects.isNull(primaryIndex) : "Unmanaged index descriptors should not have a primary index"; - assert Objects.isNull(mappingsNodeVersionMetaKey) : "Unmanaged index descriptors should not have a version meta key"; - this.mappingsNodeVersion = null; this.mappingsVersion = null; } @@ -310,8 +286,8 @@ protected SystemIndexDescriptor( Objects.requireNonNull(priorSystemIndexDescriptors, "priorSystemIndexDescriptors must not be null"); if (priorSystemIndexDescriptors.isEmpty() == false) { // the rules for prior system index descriptors - // 1. No values with the same minimum node version - // 2. All prior system index descriptors must have a minimumNodeVersion before this one + // 1. No values with the same minimum mappings version + // 2. All prior system index descriptors must have a lower mappings version // 3. Prior system index descriptors may not have other prior system index descriptors // to avoid multiple branches that need followed // 4. Must have same indexPattern, primaryIndex, and alias @@ -383,9 +359,7 @@ protected SystemIndexDescriptor( throw new IllegalArgumentException("System indices must have " + IndexMetadata.SETTING_INDEX_HIDDEN + " set to true."); } this.indexFormat = indexFormat; - this.mappingsNodeVersionMetaKey = mappingsNodeVersionMetaKey; this.origin = origin; - this.minimumNodeVersion = minimumNodeVersion; this.type = type; this.allowedElasticProductOrigins = allowedElasticProductOrigins; this.hasDynamicMappings = this.mappings != null @@ -478,16 +452,6 @@ public int getIndexFormat() { return this.indexFormat; } - public String getMappingsNodeVersionMetaKey() { - assert isAutomaticallyManaged() : "Do not request version meta keys for unmanaged system indices"; - return this.mappingsNodeVersionMetaKey; - } - - public Version getMinimumNodeVersion() { - assert isAutomaticallyManaged() : "Do not request version minimum node version for unmanaged system indices"; - return minimumNodeVersion; - } - public boolean isAutomaticallyManaged() { return type.isManaged(); } @@ -534,18 +498,6 @@ public boolean allowsTemplates() { return allowsTemplates; } - /** - * Use of the mappings {@link Version} should be replaced with the value returned from {@link #getMappingsVersion()} - * @return Elasticsearch version associated with this descriptor's mappings. - */ - @Deprecated - public Version getMappingsNodeVersion() { - if (isAutomaticallyManaged() == false) { - throw new IllegalStateException(this + " is not managed so there are no mappings or version"); - } - return mappingsNodeVersion; - } - public MappingsVersion getMappingsVersion() { if (isAutomaticallyManaged() == false) { throw new IllegalStateException(this + " is not managed so there are no mappings or version"); @@ -554,7 +506,7 @@ public MappingsVersion getMappingsVersion() { } /** - * Gets a standardized message when the node contains a data or master node whose version is less + * Gets a standardized message when the node contains a data or master node whose mappings version is less * than that of the minimum supported version of this descriptor and its prior descriptors. * * @param cause the action being attempted that triggered the check. Used in the error message. @@ -573,55 +525,12 @@ public String getMinimumMappingsVersionMessage(String cause) { ); } - /** - * Gets a standardized message when the node contains a data or master node whose version is less - * than that of the minimum supported version of this descriptor and its prior descriptors. - * - * @param cause the action being attempted that triggered the check. Used in the error message. - * @return the standardized error message - */ - @Deprecated - public String getMinimumNodeVersionMessage(String cause) { - Objects.requireNonNull(cause); - final Version actualMinimumVersion = priorSystemIndexDescriptors.isEmpty() - ? minimumNodeVersion - : priorSystemIndexDescriptors.get(priorSystemIndexDescriptors.size() - 1).minimumNodeVersion; - return String.format( - Locale.ROOT, - "[%s] failed - system index [%s] requires all data and master nodes to be at least version [%s]", - cause, - this.getPrimaryIndex(), - actualMinimumVersion - ); - } - /** * Finds the descriptor that can be used within this cluster, by comparing the supplied minimum - * node version to this descriptor's minimum version and the prior descriptors minimum version. + * mappings version to this descriptor's minimum version and the prior descriptors minimum version. * - * @param version the lower node version in the cluster - * @return null if the lowest node version is lower than the minimum version in this descriptor, - * or the appropriate descriptor if the supplied version is acceptable. - */ - @Deprecated - public SystemIndexDescriptor getDescriptorCompatibleWith(Version version) { - if (minimumNodeVersion.onOrBefore(version)) { - return this; - } - for (SystemIndexDescriptor prior : priorSystemIndexDescriptors) { - if (version.onOrAfter(prior.minimumNodeVersion)) { - return prior; - } - } - return null; - } - - /** - * Finds the descriptor that can be used within this cluster, by comparing the supplied minimum - * node version to this descriptor's minimum version and the prior descriptors minimum version. - * - * @param version the lower node version in the cluster - * @return null if the lowest node version is lower than the minimum version in this descriptor, + * @param version the lower mappings version in the cluster + * @return null if the lowest mappings version is lower than the minimum version in this descriptor, * or the appropriate descriptor if the supplied version is acceptable. */ public SystemIndexDescriptor getDescriptorCompatibleWith(MappingsVersion version) { @@ -637,8 +546,7 @@ public SystemIndexDescriptor getDescriptorCompatibleWith(MappingsVersion version } /** - * @return The names of thread pools that should be used for operations on this - * system index. + * @return The names of thread pools that should be used for operations on this system index. */ public ExecutorNames getThreadPoolNames() { return this.executorNames; @@ -650,7 +558,7 @@ public static Builder builder() { @Override public int compareTo(SystemIndexDescriptor other) { - return minimumNodeVersion.compareTo(other.minimumNodeVersion) * -1; + return mappingsVersion.compareTo(other.mappingsVersion) * -1; } /** @@ -745,9 +653,7 @@ public static class Builder { private Settings settings = null; private String aliasName = null; private int indexFormat = 0; - private String versionMetaKey = null; private String origin = null; - private Version minimumNodeVersion = Version.CURRENT.minimumCompatibilityVersion(); private Type type = Type.INTERNAL_MANAGED; private List allowedElasticProductOrigins = List.of(); private List priorSystemIndexDescriptors = List.of(); @@ -797,11 +703,6 @@ public Builder setIndexFormat(int indexFormat) { return this; } - public Builder setVersionMetaKey(String versionMetaKey) { - this.versionMetaKey = versionMetaKey; - return this; - } - /** * Sometimes a system operation will need to dispatch sub-actions. A product origin string will tell the system which component * generated the sub-action. Internal system indices must not provide an origin, since they are supposed to reject access from @@ -815,11 +716,6 @@ public Builder setOrigin(String origin) { return this; } - public Builder setMinimumNodeVersion(Version version) { - this.minimumNodeVersion = version; - return this; - } - public Builder setType(Type type) { this.type = type; return this; @@ -863,9 +759,7 @@ public SystemIndexDescriptor build() { settings, aliasName, indexFormat, - versionMetaKey, origin, - minimumNodeVersion, type, allowedElasticProductOrigins, priorSystemIndexDescriptors, @@ -962,44 +856,4 @@ private static MappingsVersion extractVersionFromMappings(String mappings) { } return new MappingsVersion(value, Objects.hash(properties)); } - - /** - * An accurate node version is no longer required in system index mappings metadata. - * because the mappings version should be used to determine if an upgrade is required, - * not the node version. However, some parts of the code are still relying on - * mappingsNodeVersion. This method allows sections of the code to stop - * accurately setting node version in their mappings while other sections continue to - * use it. Once all uses of mappingsNodeVersion are removed this method - * can be removed too. - */ - @Deprecated - private static Version bestEffortExtractNodeVersionFromMappings(String mappings, String versionMetaKey) { - try { - return extractNodeVersionFromMappings(mappings, versionMetaKey); - } catch (Exception e) { - return null; - } - } - - @Deprecated - @SuppressWarnings("unchecked") - private static Version extractNodeVersionFromMappings(String mappings, String versionMetaKey) { - final Map mappingsMap = XContentHelper.convertToMap(XContentType.JSON.xContent(), mappings, false); - final Map doc = (Map) mappingsMap.get("_doc"); - final Map meta; - if (doc == null) { - meta = (Map) mappingsMap.get("_meta"); - } else { - meta = (Map) doc.get("_meta"); - } - if (meta == null) { - throw new IllegalStateException("mappings do not have _meta field"); - } - final String value = (String) meta.get(versionMetaKey); - if (value == null) { - throw new IllegalArgumentException("mappings do not have a version in _meta." + versionMetaKey); - } - return Version.fromString(value); - } - } diff --git a/server/src/main/java/org/elasticsearch/synonyms/SynonymsManagementAPIService.java b/server/src/main/java/org/elasticsearch/synonyms/SynonymsManagementAPIService.java index c760e8043e262..72d0a1330a249 100644 --- a/server/src/main/java/org/elasticsearch/synonyms/SynonymsManagementAPIService.java +++ b/server/src/main/java/org/elasticsearch/synonyms/SynonymsManagementAPIService.java @@ -106,7 +106,6 @@ public class SynonymsManagementAPIService { .setIndexFormat(SYNONYMS_INDEX_FORMAT) .setMappings(mappings()) .setSettings(settings()) - .setVersionMetaKey("version") .setOrigin(SYNONYMS_ORIGIN) .build(); diff --git a/server/src/main/java/org/elasticsearch/tasks/TaskResultsService.java b/server/src/main/java/org/elasticsearch/tasks/TaskResultsService.java index 0c9833fad7640..cafad960c168f 100644 --- a/server/src/main/java/org/elasticsearch/tasks/TaskResultsService.java +++ b/server/src/main/java/org/elasticsearch/tasks/TaskResultsService.java @@ -59,7 +59,6 @@ public class TaskResultsService { .setDescription("Task Result Index") .setSettings(getTaskResultIndexSettings()) .setMappings(getTaskResultIndexMappings()) - .setVersionMetaKey(TASK_RESULT_MAPPING_VERSION_META_FIELD) .setOrigin(TASKS_ORIGIN) .build(); diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesActionTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesActionTests.java index b40078ca7f1a9..ec5f0b489d6ef 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesActionTests.java @@ -277,7 +277,6 @@ public void testNetNewSystemIndicesDontErrorWhenNotRequested() { .setDescription(this.getTestName()) .setMappings("{\"_meta\": {\"version\": \"1.0.0\", \"" + SystemIndexDescriptor.VERSION_META_KEY + "\": 0}}") .setSettings(Settings.EMPTY) - .setVersionMetaKey("version") .setOrigin(this.getTestName()) .setNetNew() .build(); diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/create/TransportCreateIndexActionTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/create/TransportCreateIndexActionTests.java index 7e590dc2cdeec..9f8b4da357ee5 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/create/TransportCreateIndexActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/create/TransportCreateIndexActionTests.java @@ -104,7 +104,6 @@ public class TransportCreateIndexActionTests extends ESTestCase { } }" """, SystemIndexDescriptor.VERSION_META_KEY)) - .setVersionMetaKey("version") .setOrigin("origin") .build() ) diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexTests.java index 834bacd9e6a04..423de4b43088f 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexTests.java @@ -525,7 +525,6 @@ private SystemIndices addSystemIndex(Metadata.Builder mdBuilder) { } """, SystemIndexDescriptor.VERSION_META_KEY)) .setPrimaryIndex(".test-net-new-system-1") - .setVersionMetaKey("version") .setOrigin("system") .build() ) diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/SystemIndexMetadataUpgradeServiceTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/SystemIndexMetadataUpgradeServiceTests.java index ac9d5021329ab..0dcea706e7f94 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/SystemIndexMetadataUpgradeServiceTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/SystemIndexMetadataUpgradeServiceTests.java @@ -46,7 +46,6 @@ public class SystemIndexMetadataUpgradeServiceTests extends ESTestCase { .setAliasName(SYSTEM_ALIAS_NAME) .setSettings(getSettingsBuilder().build()) .setMappings(MAPPINGS) - .setVersionMetaKey("version") .setOrigin("FAKE_ORIGIN") .build(); diff --git a/server/src/test/java/org/elasticsearch/indices/SystemIndexDescriptorTests.java b/server/src/test/java/org/elasticsearch/indices/SystemIndexDescriptorTests.java index 59d5cf4359bb1..eedd7c2594691 100644 --- a/server/src/test/java/org/elasticsearch/indices/SystemIndexDescriptorTests.java +++ b/server/src/test/java/org/elasticsearch/indices/SystemIndexDescriptorTests.java @@ -10,14 +10,12 @@ package org.elasticsearch.indices; import org.apache.lucene.util.automaton.CharacterRunAutomaton; -import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.indices.SystemIndexDescriptor.Type; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.VersionUtils; import org.elasticsearch.xcontent.json.JsonXContent; import java.util.List; @@ -38,7 +36,6 @@ public class SystemIndexDescriptorTests extends ESTestCase { { "_doc": { "_meta": { - "version": "7.4.0", "%s": %d } } @@ -211,7 +208,6 @@ public void testPriorSystemIndexDescriptorValidation() { .setType(Type.INTERNAL_MANAGED) .setSettings(Settings.EMPTY) .setMappings(getVersionedMappings(TEST_MAPPINGS_VERSION + 1)) - .setVersionMetaKey("version") .setOrigin("system") .setPriorSystemIndexDescriptors(List.of(prior)) .build() @@ -272,9 +268,7 @@ public void testGetDescriptorCompatibleWith() { .setType(Type.INTERNAL_MANAGED) .setSettings(Settings.EMPTY) .setMappings(getVersionedMappings(TEST_MAPPINGS_PRIOR_VERSION)) - .setVersionMetaKey("version") .setOrigin("system") - .setMinimumNodeVersion(Version.V_7_0_0) .build(); final SystemIndexDescriptor descriptor = SystemIndexDescriptor.builder() .setIndexPattern(".system*") @@ -284,27 +278,15 @@ public void testGetDescriptorCompatibleWith() { .setType(Type.INTERNAL_MANAGED) .setSettings(Settings.EMPTY) .setMappings(MAPPINGS) - .setVersionMetaKey("version") .setOrigin("system") .setPriorSystemIndexDescriptors(List.of(prior)) .build(); - SystemIndexDescriptor compat = descriptor.getDescriptorCompatibleWith(Version.CURRENT); + SystemIndexDescriptor compat = descriptor.getDescriptorCompatibleWith(descriptor.getMappingsVersion()); assertSame(descriptor, compat); - compat = descriptor.getDescriptorCompatibleWith(descriptor.getMappingsVersion()); - assertSame(descriptor, compat); - - assertNull(descriptor.getDescriptorCompatibleWith(Version.fromString("6.8.0"))); assertNull(descriptor.getDescriptorCompatibleWith(new SystemIndexDescriptor.MappingsVersion(TEST_MAPPINGS_NONEXISTENT_VERSION, 1))); - compat = descriptor.getDescriptorCompatibleWith(Version.CURRENT.minimumCompatibilityVersion()); - assertSame(descriptor, compat); - - Version priorToMin = VersionUtils.getPreviousVersion(descriptor.getMinimumNodeVersion()); - compat = descriptor.getDescriptorCompatibleWith(priorToMin); - assertSame(prior, compat); - SystemIndexDescriptor.MappingsVersion priorToMinMappingsVersion = new SystemIndexDescriptor.MappingsVersion( TEST_MAPPINGS_PRIOR_VERSION, 1 @@ -312,11 +294,6 @@ public void testGetDescriptorCompatibleWith() { compat = descriptor.getDescriptorCompatibleWith(priorToMinMappingsVersion); assertSame(prior, compat); - compat = descriptor.getDescriptorCompatibleWith( - VersionUtils.randomVersionBetween(random(), prior.getMinimumNodeVersion(), priorToMin) - ); - assertSame(prior, compat); - compat = descriptor.getDescriptorCompatibleWith( new SystemIndexDescriptor.MappingsVersion(randomIntBetween(TEST_MAPPINGS_PRIOR_VERSION, TEST_MAPPINGS_VERSION - 1), 1) ); @@ -331,7 +308,6 @@ public void testSystemIndicesMustBeHidden() { .setAliasName(".system") .setType(Type.INTERNAL_MANAGED) .setMappings(MAPPINGS) - .setVersionMetaKey("version") .setOrigin("system"); builder.setSettings(Settings.builder().put(IndexMetadata.SETTING_INDEX_HIDDEN, false).build()); @@ -371,7 +347,6 @@ public void testManagedSystemIndexMustHaveMatchingIndexFormat() { .setMappings(MAPPINGS) .setSettings(Settings.builder().put("index.format", 5).build()) .setIndexFormat(0) - .setVersionMetaKey("version") .setOrigin("system"); IllegalArgumentException e = expectThrows(IllegalArgumentException.class, builder::build); @@ -394,16 +369,7 @@ public void testUnmanagedIndexMappingsVersion() { // test mapping versions can't be negative public void testNegativeMappingsVersion() { int negativeVersion = randomIntBetween(Integer.MIN_VALUE, -1); - String mappings = Strings.format(""" - { - "_doc": { - "_meta": { - "version": "7.4.0", - "%s": %d - } - } - } - """, SystemIndexDescriptor.VERSION_META_KEY, negativeVersion); + String mappings = Strings.format(MAPPINGS_FORMAT_STRING, SystemIndexDescriptor.VERSION_META_KEY, negativeVersion); SystemIndexDescriptor.Builder builder = priorSystemIndexDescriptorBuilder().setMappings(mappings); @@ -429,7 +395,6 @@ public void testHashesIgnoreMappingMetadata() { { "_doc": { "_meta": { - "version": "%s", "%s": %d } }, @@ -441,15 +406,14 @@ public void testHashesIgnoreMappingMetadata() { } """; - String mappings1 = Strings.format(mappingFormatString, "8.9.0", SystemIndexDescriptor.VERSION_META_KEY, randomIntBetween(1, 10)); - String mappings2 = Strings.format(mappingFormatString, "8.10.0", SystemIndexDescriptor.VERSION_META_KEY, randomIntBetween(11, 20)); + String mappings1 = Strings.format(mappingFormatString, SystemIndexDescriptor.VERSION_META_KEY, randomIntBetween(1, 10)); + String mappings2 = Strings.format(mappingFormatString, SystemIndexDescriptor.VERSION_META_KEY, randomIntBetween(11, 20)); SystemIndexDescriptor descriptor1 = priorSystemIndexDescriptorBuilder().setMappings(mappings1).build(); SystemIndexDescriptor descriptor2 = priorSystemIndexDescriptorBuilder().setMappings(mappings2).build(); assertThat(descriptor1.getMappingsVersion().hash(), equalTo(descriptor2.getMappingsVersion().hash())); assertThat(descriptor1.getMappingsVersion().version(), not(equalTo(descriptor2.getMappingsVersion().version()))); - assertThat(descriptor1.getMappingsNodeVersion(), not(equalTo(descriptor2.getMappingsNodeVersion()))); } private SystemIndexDescriptor.Builder priorSystemIndexDescriptorBuilder() { @@ -461,8 +425,6 @@ private SystemIndexDescriptor.Builder priorSystemIndexDescriptorBuilder() { .setType(Type.INTERNAL_MANAGED) .setSettings(Settings.EMPTY) .setMappings(MAPPINGS) - .setVersionMetaKey("version") - .setOrigin("system") - .setMinimumNodeVersion(Version.V_7_0_0); + .setOrigin("system"); } } diff --git a/server/src/test/java/org/elasticsearch/indices/SystemIndexMappingUpdateServiceTests.java b/server/src/test/java/org/elasticsearch/indices/SystemIndexMappingUpdateServiceTests.java index 14536e76f3c04..795c3782ac47c 100644 --- a/server/src/test/java/org/elasticsearch/indices/SystemIndexMappingUpdateServiceTests.java +++ b/server/src/test/java/org/elasticsearch/indices/SystemIndexMappingUpdateServiceTests.java @@ -74,7 +74,6 @@ public class SystemIndexMappingUpdateServiceTests extends ESTestCase { .setIndexFormat(6) .setSettings(getSettings()) .setMappings(getMappings()) - .setVersionMetaKey("version") .setOrigin("FAKE_ORIGIN") .build(); @@ -103,7 +102,6 @@ public void testManagerSkipsDescriptorsThatAreNotManaged() { .setMappings(getMappings()) .setSettings(getSettings()) .setIndexFormat(6) - .setVersionMetaKey("version") .setOrigin("FAKE_ORIGIN") .build(); @@ -137,7 +135,6 @@ public void testManagerSkipsDescriptorsForIndicesThatDoNotExist() { .setMappings(getMappings()) .setSettings(getSettings()) .setIndexFormat(6) - .setVersionMetaKey("version") .setOrigin("FAKE_ORIGIN") .build(); SystemIndexDescriptor d2 = SystemIndexDescriptor.builder() @@ -146,7 +143,6 @@ public void testManagerSkipsDescriptorsForIndicesThatDoNotExist() { .setMappings(getMappings()) .setSettings(getSettings()) .setIndexFormat(6) - .setVersionMetaKey("version") .setOrigin("FAKE_ORIGIN") .build(); diff --git a/server/src/test/java/org/elasticsearch/indices/SystemIndicesTests.java b/server/src/test/java/org/elasticsearch/indices/SystemIndicesTests.java index 77f3d75015d0d..dfcb1c0f1db9b 100644 --- a/server/src/test/java/org/elasticsearch/indices/SystemIndicesTests.java +++ b/server/src/test/java/org/elasticsearch/indices/SystemIndicesTests.java @@ -263,7 +263,6 @@ public void testMappingsVersions() { SystemIndexDescriptor managed = SystemIndexDescriptor.builder() .setIndexPattern(".managed-*") .setPrimaryIndex(".managed-primary") - .setVersionMetaKey("version") .setOrigin("system") .setSettings(Settings.EMPTY) .setMappings(""" diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/async/AsyncTaskIndexService.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/async/AsyncTaskIndexService.java index e44af60a45e08..fe970bef87145 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/async/AsyncTaskIndexService.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/async/AsyncTaskIndexService.java @@ -144,7 +144,6 @@ public static SystemIndexDescriptor getSystemIndexDescriptor() { .setPrimaryIndex(XPackPlugin.ASYNC_RESULTS_INDEX) .setMappings(mappings()) .setSettings(settings()) - .setVersionMetaKey("version") .setOrigin(ASYNC_SEARCH_ORIGIN) .build(); } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/test/TestRestrictedIndices.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/test/TestRestrictedIndices.java index 9e26444040b03..3848d785275d4 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/test/TestRestrictedIndices.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/test/TestRestrictedIndices.java @@ -179,8 +179,7 @@ public class TestRestrictedIndices { private static SystemIndexDescriptor.Builder getInitializedDescriptorBuilder(int indexFormat) { return SystemIndexDescriptor.builder() .setMappings(mockMappings()) - .setSettings(Settings.builder().put(IndexMetadata.INDEX_FORMAT_SETTING.getKey(), indexFormat).build()) - .setVersionMetaKey("version"); + .setSettings(Settings.builder().put(IndexMetadata.INDEX_FORMAT_SETTING.getKey(), indexFormat).build()); } private static SystemIndexDescriptor getMainSecurityDescriptor() { diff --git a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/connector/secrets/ConnectorSecretsIndexService.java b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/connector/secrets/ConnectorSecretsIndexService.java index ba9a3e78281dd..7c26c2975d8ee 100644 --- a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/connector/secrets/ConnectorSecretsIndexService.java +++ b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/connector/secrets/ConnectorSecretsIndexService.java @@ -70,7 +70,6 @@ public static SystemIndexDescriptor getSystemIndexDescriptor() { .setMappings(request.mappings()) .setSettings(request.settings()) .setAliasName(CONNECTOR_SECRETS_INDEX_NAME) - .setVersionMetaKey("version") .setOrigin(CONNECTORS_ORIGIN) .setType(SystemIndexDescriptor.Type.INTERNAL_MANAGED) .build(); diff --git a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/QueryRulesIndexService.java b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/QueryRulesIndexService.java index 8bf4bbd5716b7..3ce51ae5d832d 100644 --- a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/QueryRulesIndexService.java +++ b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/QueryRulesIndexService.java @@ -92,7 +92,6 @@ public static SystemIndexDescriptor getSystemIndexDescriptor() { .setSettings(getIndexSettings()) .setAliasName(QUERY_RULES_ALIAS_NAME) .setIndexFormat(QueryRulesIndexMappingVersion.latest().id) - .setVersionMetaKey("version") .setOrigin(ENT_SEARCH_ORIGIN) .setThreadPools(ExecutorNames.DEFAULT_SYSTEM_INDEX_THREAD_POOLS); diff --git a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/search/SearchApplicationIndexService.java b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/search/SearchApplicationIndexService.java index 30d533aeb9ae5..2219a2bebbd25 100644 --- a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/search/SearchApplicationIndexService.java +++ b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/search/SearchApplicationIndexService.java @@ -130,7 +130,6 @@ public static SystemIndexDescriptor getSystemIndexDescriptor() { .setMappings(getIndexMappings()) .setSettings(getIndexSettings()) .setAliasName(SEARCH_APPLICATION_ALIAS_NAME) - .setVersionMetaKey("version") .setOrigin(ENT_SEARCH_ORIGIN) .setThreadPools(ExecutorNames.DEFAULT_SYSTEM_INDEX_THREAD_POOLS) .build(); diff --git a/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java b/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java index 40e41cb18bdf8..138a07833e584 100644 --- a/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java +++ b/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java @@ -77,7 +77,6 @@ public class Fleet extends Plugin implements SystemIndexPlugin { public static final String FLEET_SECRETS_INDEX_NAME = ".fleet-secrets"; private static final int CURRENT_INDEX_VERSION = 7; - private static final String VERSION_KEY = "version"; private static final String MAPPING_VERSION_VARIABLE = "fleet.version"; private static final List ALLOWED_PRODUCTS = List.of("kibana", "fleet"); private static final int FLEET_ACTIONS_MAPPINGS_VERSION = 1; @@ -140,7 +139,6 @@ private static SystemIndexDescriptor fleetActionsSystemIndexDescriptor() { .setType(Type.EXTERNAL_MANAGED) .setAllowedElasticProductOrigins(ALLOWED_PRODUCTS) .setOrigin(FLEET_ORIGIN) - .setVersionMetaKey(VERSION_KEY) .setMappings(request.mappings()) .setSettings(request.settings()) .setPrimaryIndex(".fleet-actions-" + CURRENT_INDEX_VERSION) @@ -158,7 +156,6 @@ private static SystemIndexDescriptor fleetAgentsSystemIndexDescriptor() { .setType(Type.EXTERNAL_MANAGED) .setAllowedElasticProductOrigins(ALLOWED_PRODUCTS) .setOrigin(FLEET_ORIGIN) - .setVersionMetaKey(VERSION_KEY) .setMappings(request.mappings()) .setSettings(request.settings()) .setPrimaryIndex(".fleet-agents-" + CURRENT_INDEX_VERSION) @@ -179,7 +176,6 @@ private static SystemIndexDescriptor fleetEnrollmentApiKeysSystemIndexDescriptor .setType(Type.EXTERNAL_MANAGED) .setAllowedElasticProductOrigins(ALLOWED_PRODUCTS) .setOrigin(FLEET_ORIGIN) - .setVersionMetaKey(VERSION_KEY) .setMappings(request.mappings()) .setSettings(request.settings()) .setPrimaryIndex(".fleet-enrollment-api-keys-" + CURRENT_INDEX_VERSION) @@ -195,7 +191,6 @@ private static SystemIndexDescriptor fleetSecretsSystemIndexDescriptor() { return SystemIndexDescriptor.builder() .setType(Type.INTERNAL_MANAGED) .setOrigin(FLEET_ORIGIN) - .setVersionMetaKey(VERSION_KEY) .setMappings(request.mappings()) .setSettings(request.settings()) .setPrimaryIndex(FLEET_SECRETS_INDEX_NAME + "-" + CURRENT_INDEX_VERSION) @@ -213,7 +208,6 @@ private static SystemIndexDescriptor fleetPoliciesSystemIndexDescriptor() { .setType(Type.EXTERNAL_MANAGED) .setAllowedElasticProductOrigins(ALLOWED_PRODUCTS) .setOrigin(FLEET_ORIGIN) - .setVersionMetaKey(VERSION_KEY) .setMappings(request.mappings()) .setSettings(request.settings()) .setPrimaryIndex(".fleet-policies-" + CURRENT_INDEX_VERSION) @@ -231,7 +225,6 @@ private static SystemIndexDescriptor fleetPoliciesLeaderSystemIndexDescriptor() .setType(Type.EXTERNAL_MANAGED) .setAllowedElasticProductOrigins(ALLOWED_PRODUCTS) .setOrigin(FLEET_ORIGIN) - .setVersionMetaKey(VERSION_KEY) .setMappings(request.mappings()) .setSettings(request.settings()) .setPrimaryIndex(".fleet-policies-leader-" + CURRENT_INDEX_VERSION) @@ -249,7 +242,6 @@ private static SystemIndexDescriptor fleetServersSystemIndexDescriptors() { .setType(Type.EXTERNAL_MANAGED) .setAllowedElasticProductOrigins(ALLOWED_PRODUCTS) .setOrigin(FLEET_ORIGIN) - .setVersionMetaKey(VERSION_KEY) .setMappings(request.mappings()) .setSettings(request.settings()) .setPrimaryIndex(".fleet-servers-" + CURRENT_INDEX_VERSION) @@ -267,7 +259,6 @@ private static SystemIndexDescriptor fleetArtifactsSystemIndexDescriptors() { .setType(Type.EXTERNAL_MANAGED) .setAllowedElasticProductOrigins(ALLOWED_PRODUCTS) .setOrigin(FLEET_ORIGIN) - .setVersionMetaKey(VERSION_KEY) .setMappings(request.mappings()) .setSettings(request.settings()) .setPrimaryIndex(".fleet-artifacts-" + CURRENT_INDEX_VERSION) diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/InferencePlugin.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/InferencePlugin.java index 0450400e5ca8b..3ad1e626481bc 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/InferencePlugin.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/InferencePlugin.java @@ -288,7 +288,6 @@ public Collection getSystemIndexDescriptors(Settings sett .setDescription("Contains inference service and model configuration") .setMappings(InferenceIndex.mappingsV1()) .setSettings(InferenceIndex.settings()) - .setVersionMetaKey("version") .setOrigin(ClientHelper.INFERENCE_ORIGIN) .build(); @@ -301,7 +300,6 @@ public Collection getSystemIndexDescriptors(Settings sett .setDescription("Contains inference service and model configuration") .setMappings(InferenceIndex.mappings()) .setSettings(InferenceIndex.settings()) - .setVersionMetaKey("version") .setOrigin(ClientHelper.INFERENCE_ORIGIN) .setPriorSystemIndexDescriptors(List.of(inferenceIndexV1Descriptor)) .build(), @@ -312,7 +310,6 @@ public Collection getSystemIndexDescriptors(Settings sett .setDescription("Contains inference service secrets") .setMappings(InferenceSecretsIndex.mappings()) .setSettings(InferenceSecretsIndex.settings()) - .setVersionMetaKey("version") .setOrigin(ClientHelper.INFERENCE_ORIGIN) .setNetNew() .build() diff --git a/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/Logstash.java b/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/Logstash.java index 819f41781a307..15582e2b74768 100644 --- a/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/Logstash.java +++ b/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/Logstash.java @@ -102,7 +102,6 @@ public Collection getSystemIndexDescriptors(Settings sett .setDescription("Contains data for Logstash Central Management") .setMappings(getIndexMappings()) .setSettings(getIndexSettings()) - .setVersionMetaKey("logstash-version") .setOrigin(LOGSTASH_MANAGEMENT_ORIGIN) .build() ); diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java index 6d21654f9e161..1feb95661f33a 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java @@ -1980,7 +1980,6 @@ public Collection getSystemIndexDescriptors(Settings unus .setDescription("Contains scheduling and anomaly tracking metadata") .setMappings(MlMetaIndex.mapping()) .setSettings(MlMetaIndex.settings()) - .setVersionMetaKey("version") .setOrigin(ML_ORIGIN) .build(), SystemIndexDescriptor.builder() @@ -1989,7 +1988,6 @@ public Collection getSystemIndexDescriptors(Settings unus .setDescription("Contains ML configuration data") .setMappings(MlConfigIndex.mapping()) .setSettings(MlConfigIndex.settings()) - .setVersionMetaKey("version") .setOrigin(ML_ORIGIN) .build(), getInferenceIndexSystemIndexDescriptor() @@ -2003,7 +2001,6 @@ public static SystemIndexDescriptor getInferenceIndexSystemIndexDescriptor() { .setDescription("Contains ML model configuration and statistics") .setMappings(InferenceIndexConstants.mapping()) .setSettings(InferenceIndexConstants.settings()) - .setVersionMetaKey("version") .setOrigin(ML_ORIGIN) .build(); } diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java index 5ac8cdb43aa33..eabdf7c9bf46c 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java @@ -397,7 +397,6 @@ public Collection getSystemIndexDescriptors(Settings unus .setMappings(getIndexMappings()) .setSettings(getIndexSettings()) .setOrigin(SEARCHABLE_SNAPSHOTS_ORIGIN) - .setVersionMetaKey("version") .build() ); } diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/support/SecuritySystemIndices.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/support/SecuritySystemIndices.java index 77c7d19e94a9b..609e6696bcb0f 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/support/SecuritySystemIndices.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/support/SecuritySystemIndices.java @@ -143,7 +143,6 @@ private SystemIndexDescriptor getSecurityMainIndexDescriptor() { .setSettings(getMainIndexSettings()) .setAliasName(SECURITY_MAIN_ALIAS) .setIndexFormat(INTERNAL_MAIN_INDEX_FORMAT) - .setVersionMetaKey(SECURITY_VERSION_STRING) .setOrigin(SECURITY_ORIGIN) .setThreadPools(ExecutorNames.CRITICAL_SYSTEM_INDEX_THREAD_POOLS); @@ -695,7 +694,6 @@ private static SystemIndexDescriptor getSecurityTokenIndexDescriptor() { .setSettings(getTokenIndexSettings()) .setAliasName(SECURITY_TOKENS_ALIAS) .setIndexFormat(INTERNAL_TOKENS_INDEX_FORMAT) - .setVersionMetaKey(SECURITY_VERSION_STRING) .setOrigin(SECURITY_ORIGIN) .setThreadPools(ExecutorNames.CRITICAL_SYSTEM_INDEX_THREAD_POOLS) .build(); @@ -879,10 +877,8 @@ private SystemIndexDescriptor getSecurityProfileIndexDescriptor(Settings setting .setSettings(getProfileIndexSettings(settings)) .setAliasName(SECURITY_PROFILE_ALIAS) .setIndexFormat(INTERNAL_PROFILE_INDEX_FORMAT) - .setVersionMetaKey(SECURITY_VERSION_STRING) .setOrigin(SECURITY_PROFILE_ORIGIN) // new origin since 8.3 .setThreadPools(ExecutorNames.CRITICAL_SYSTEM_INDEX_THREAD_POOLS) - .setMinimumNodeVersion(VERSION_SECURITY_PROFILE_ORIGIN) .setPriorSystemIndexDescriptors( List.of( SystemIndexDescriptor.builder() @@ -893,7 +889,6 @@ private SystemIndexDescriptor getSecurityProfileIndexDescriptor(Settings setting .setSettings(getProfileIndexSettings(settings)) .setAliasName(SECURITY_PROFILE_ALIAS) .setIndexFormat(INTERNAL_PROFILE_INDEX_FORMAT) - .setVersionMetaKey(SECURITY_VERSION_STRING) .setOrigin(SECURITY_ORIGIN) .setThreadPools(ExecutorNames.CRITICAL_SYSTEM_INDEX_THREAD_POOLS) .build() diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/persistence/TransformInternalIndex.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/persistence/TransformInternalIndex.java index e2f9af2c676ce..14e9292d10fd1 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/persistence/TransformInternalIndex.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/persistence/TransformInternalIndex.java @@ -111,7 +111,6 @@ public static SystemIndexDescriptor getSystemIndexDescriptor(Settings transformI .setDescription("Contains Transform configuration data") .setMappings(mappings()) .setSettings(settings(transformInternalIndexAdditionalSettings)) - .setVersionMetaKey("version") .setOrigin(TRANSFORM_ORIGIN) .build(); } diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java index f6f8d3f336e21..cd965bb677526 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java @@ -802,7 +802,6 @@ public Collection getSystemIndexDescriptors(Settings sett .setDescription("Contains Watch definitions") .setMappings(getWatchesIndexMappings()) .setSettings(getWatchesIndexSettings()) - .setVersionMetaKey("version") .setOrigin(WATCHER_ORIGIN) .setIndexFormat(6) .build(), @@ -812,7 +811,6 @@ public Collection getSystemIndexDescriptors(Settings sett .setDescription("Used to track current and queued Watch execution") .setMappings(getTriggeredWatchesIndexMappings()) .setSettings(getTriggeredWatchesIndexSettings()) - .setVersionMetaKey("version") .setOrigin(WATCHER_ORIGIN) .setIndexFormat(6) .build()