Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use settings infrastructure for shards and replicas #56801

Conversation

jasontedor
Copy link
Member

We get the number of shards and replicas with our bare hands in index metadata, rather than letting the settings infrastructure do the work for us. This commit switches to using the settings infrastructure.

Relates #56712

We get the number of shards and replicas with our bare hands in index
metadata, rather than letting the settings infrastructure do the work
for us. This commit switches to using the settings infrastructure.
@jasontedor jasontedor requested a review from rjernst May 15, 2020 00:46
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Settings)

@rjernst
Copy link
Member

rjernst commented May 15, 2020

I don't think this addresses the problem I was trying to solve in #56712. The problem as I see it is both MetadataCreateIndexService and MetadataUpdateSettingsService both having their own default value logic, instead of using the Setting. Thus the default of 1 is defined in several places.

@jasontedor
Copy link
Member Author

@rjernst I took it further.

@jasontedor
Copy link
Member Author

@elasticmachine update branch

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes. It still seems odd to me to be reading and setting back as we do, but as I understand from your comments there are other places constructing IndexMetadata with temporary values for the number of replicas. Is that the case for shards though? Shouldn't that never change, so we could always read it in IndexMetadata and not read+set externally?

Either way, this is better than what existed since the default value no longer exists in multiple places, thank you! LGTM.

@jasontedor jasontedor merged commit ce61d9c into elastic:master May 15, 2020
jasontedor added a commit that referenced this pull request May 15, 2020
We get the number of shards and replicas with our bare hands in index
metadata, rather than letting the settings infrastructure do the work
for us. This commit switches to using the settings infrastructure.
@jasontedor jasontedor deleted the index-metadata-use-settings-infrastructure branch May 15, 2020 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Settings Settings infrastructure and APIs >non-issue Team:Core/Infra Meta label for core/infra team v7.9.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants