Skip to content

Commit

Permalink
Remove Version from system index descriptors (#115793)
Browse files Browse the repository at this point in the history
Now it just uses mapping versions
  • Loading branch information
thecoop authored Oct 31, 2024
1 parent 130cc74 commit 04e04ce
Show file tree
Hide file tree
Showing 30 changed files with 14 additions and 259 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ public Collection<SystemIndexDescriptor> getSystemIndexDescriptors(Settings sett
.build()
)
.setOrigin(INGEST_ORIGIN)
.setVersionMetaKey("version")
.setPrimaryIndex(DATABASES_INDEX)
.setNetNew()
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,13 @@ 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()
.setIndexPattern(".int-unman-*")
.setType(SystemIndexDescriptor.Type.INTERNAL_UNMANAGED)
.setOrigin(ORIGIN)
.setAllowedElasticProductOrigins(Collections.emptyList())
.setMinimumNodeVersion(NEEDS_UPGRADE_VERSION)
.setPriorSystemIndexDescriptors(Collections.emptyList())
.build();

Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ public Collection<SystemIndexDescriptor> getSystemIndexDescriptors(Settings sett
.setPrimaryIndex(SYSTEM_INDEX_NAME)
.setDescription("Test system index")
.setOrigin(getClass().getName())
.setVersionMetaKey("version")
.setMappings(builder)
.setSettings(SETTINGS)
.setType(Type.INTERNAL_MANAGED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public Collection<SystemIndexDescriptor> getSystemIndexDescriptors(Settings sett
.build()
)
.setOrigin(TASKS_ORIGIN)
.setVersionMetaKey("version")
.setPrimaryIndex(".net-new-system-index-primary")
.build(),
SystemIndexDescriptor.builder()
Expand All @@ -99,7 +98,6 @@ public Collection<SystemIndexDescriptor> getSystemIndexDescriptors(Settings sett
.build()
)
.setOrigin(TASKS_ORIGIN)
.setVersionMetaKey("version")
.setPrimaryIndex(".internal-managed-index-primary")
.setAliasName(".internal-managed-alias")
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ public Collection<SystemIndexDescriptor> 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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -51,9 +50,7 @@ public class TestSystemIndexDescriptor extends SystemIndexDescriptor {
SETTINGS,
INDEX_NAME,
0,
"version",
"stack",
null,
Type.INTERNAL_MANAGED,
List.of(),
List.of(),
Expand All @@ -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(),
Expand Down
Loading

0 comments on commit 04e04ce

Please sign in to comment.