IndexMetaData: Introduce internal format index setting#25292
Merged
spinscale merged 5 commits intoelastic:masterfrom Jun 21, 2017
Merged
IndexMetaData: Introduce internal format index setting#25292spinscale merged 5 commits intoelastic:masterfrom
spinscale merged 5 commits intoelastic:masterfrom
Conversation
This setting is supposed to ease index upgrades as it allows you to check for a new setting called `index.internal.version` which in turn can be configured in the index settings and has to be set to '6' in order to be valid.
s1monw
suggested changes
Jun 20, 2017
| private static final String INDEX_INTERNAL_FORMAT = "index.internal.format"; | ||
| public static final Setting<Integer> INDEX_INTERNAL_FORMAT_SETTING = | ||
| Setting.intSetting(INDEX_INTERNAL_FORMAT, 0, Setting.Property.IndexScope); | ||
| static final int INTERNAL_INDEX_FORMAT_CURRENT = 6; |
Contributor
There was a problem hiding this comment.
maybe we make this a bit more generic and call it index.format and INTERNAL_INDEX_FORMAT_CURRENT should not be here. it's up to every user of this setting to define the current?
| private final Index index; | ||
| private final long version; | ||
| private final long[] primaryTerms; | ||
| private final int internalIndexFormat; |
Contributor
There was a problem hiding this comment.
do we really have to make this a first class citizen or can we just leave it as a setting?
Contributor
Author
There was a problem hiding this comment.
makes more sense as a setting. fixed
| * an internal index format description, allowing us to find out if this index is upgraded or needs upgrading | ||
| */ | ||
| private static final String INDEX_INTERNAL_FORMAT = "index.internal.format"; | ||
| public static final Setting<Integer> INDEX_INTERNAL_FORMAT_SETTING = |
Contributor
There was a problem hiding this comment.
also make this setting Setting.Property.Final
Contributor
Author
There was a problem hiding this comment.
oooh, wasnt aware of that. great!
- Make the setting final - Do not expose an own getter, just extract the setting via IndexMetaData.getSettings() - also no need to put this into hashCode()/equals() - Make more generic and rename to `index.format` - Allow the user to choose the correct value and just return that value
Contributor
Author
|
all comments made a ton of sense. incorporated. |
s1monw
suggested changes
Jun 20, 2017
| DiscoveryNodeFilters requireFilters, DiscoveryNodeFilters initialRecoveryFilters, DiscoveryNodeFilters includeFilters, DiscoveryNodeFilters excludeFilters, | ||
| Version indexCreatedVersion, Version indexUpgradedVersion, | ||
| int routingNumShards, int routingPartitionSize, ActiveShardCount waitForActiveShards) { | ||
| int routingNumShards, int routingPartitionSize, ActiveShardCount waitForActiveShards, int internalIndexFormat) { |
|
|
||
| final String uuid = settings.get(SETTING_INDEX_UUID, INDEX_UUID_NA_VALUE); | ||
|
|
||
| int internalIndexFormat = INDEX_FORMAT_SETTING.get(settings); |
| return new IndexMetaData(new Index(index, uuid), version, primaryTerms, state, numberOfShards, numberOfReplicas, tmpSettings, mappings.build(), | ||
| tmpAliases.build(), customs.build(), filledInSyncAllocationIds.build(), requireFilters, initialRecoveryFilters, includeFilters, excludeFilters, | ||
| indexCreatedVersion, indexUpgradedVersion, getRoutingNumShards(), routingPartitionSize, waitForActiveShards); | ||
| indexCreatedVersion, indexUpgradedVersion, getRoutingNumShards(), routingPartitionSize, waitForActiveShards, internalIndexFormat); |
spinscale
added a commit
that referenced
this pull request
Jun 21, 2017
This setting is supposed to ease index upgrades as it allows you to check for a new setting called `index.internal.version` which can be used to check before upgrading indices.
jasontedor
added a commit
to jasontedor/elasticsearch
that referenced
this pull request
Jun 22, 2017
* master: (56 commits) Initialize max unsafe auto ID timestamp on shrink Enable a long translog retention policy by default (elastic#25294) Remove `index.mapping.single_type=false` from core/tests (elastic#25331) test: single type defaults to true since alpha1 and not alpha3 Get short path name for native controllers Live primary-replica resync (no rollback) (elastic#24841) Upgrade to lucene-7.0.0-snapshot-ad2cb77. (elastic#25349) percolator: Deprecate `document_type` parameter. [DOCS] Fixed typo. [rest-api-spec/indices.refresh] Remove old params Remove redundant and broken MD5 checksum from repository-s3 (elastic#25270) Initialize sequence numbers on a shrunken index Port most snapshot/restore static bwc tests to qa:full-cluster-restart (elastic#25296) Javadoc: ThreadPool doesn't reject while shutdown (elastic#23678) test: verify `size_to_upgrade_in_bytes` in assertBusy(...) Docs: Removed duplicated line in mapping docs Add backward compatibility indices for 5.4.2 Update MockTransportService to the age of Transport.Connection (elastic#25320) Add version v5.4.2 after release IndexMetaData: Add internal format index setting (elastic#25292) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This setting is supposed to ease index upgrades as it allows you
to check for a new setting called
index.internal.versionwhichin turn can be configured in the index settings and has to be set
to '6' in order to be valid.