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

Deprecate updating replica count with auto-expand #73230

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

DaveCTurner
Copy link
Contributor

Today if you update index.number_of_replicas on indices that have
index.auto_expand_replicas set then the update is accepted but
silently ignored. Lenience like this is surprising. This commit
deprecates this behaviour so that it can be removed in a future release.

Relates #27835

Today if you update `index.number_of_replicas` on indices that have
`index.auto_expand_replicas` set then the update is accepted but
silently ignored. Lenience like this is surprising. This commit
deprecates this behaviour so that it can be removed in a future release.

Relates elastic#27835
@DaveCTurner DaveCTurner added >deprecation :Distributed/Distributed A catch all label for anything in the Distributed Area. If you aren't sure, use this one. v8.0.0 v7.14.0 labels May 19, 2021
@elasticmachine elasticmachine added the Team:Distributed Meta label for distributed team label May 19, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

@@ -756,7 +756,6 @@ public synchronized void updateMetadata(final IndexMetadata currentIndexMetadata
if (currentSettingsVersion == newSettingsVersion) {
assert updateIndexSettings == false;
} else {
assert updateIndexSettings;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This assertion almost holds but fails in cases where you set index.number_of_replicas and then auto-expand replicas sets it back again. I think it's ok to drop it, it's not really a big deal to process the occasional no-op update.

@@ -130,6 +135,31 @@ public ClusterState execute(ClusterState currentState) {
}

if (IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.exists(openSettings)) {

final boolean updatingReplicasHasEffect;
if (IndexMetadata.INDEX_AUTO_EXPAND_REPLICAS_SETTING.exists(openSettings)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

NB this doesn't account for updates that use wildcards, but nor does the rest of this logic.

@DaveCTurner
Copy link
Contributor Author

I apparently failed to include a top-level review comment, here's what I meant to say:

I'm not 100% set on this direction, we could reasonably argue that today's behaviour is preferred and therefore close #27835 maybe with some docs changes. We permit other kinds of no-op updates, removing settings that are not even set, or targeting zero indices with a wildcard, and maybe making this call fail will just be painful for clients. It's not like we've seen a lot of interest in fixing this since 2017. Thought it'd be useful to pin down exactly what would be needed to resolve the issue anyway.

@elasticsearchmachine
Copy link
Collaborator

Hi @DaveCTurner, I've created a changelog YAML for you. Note that since this PR is labelled >deprecation, you need to update the changelog YAML to fill out the extended information sections.

@elasticsearchmachine elasticsearchmachine changed the base branch from master to main July 22, 2022 23:11
@mark-vieira mark-vieira added v8.5.0 and removed v8.4.0 labels Jul 27, 2022
@DaveCTurner DaveCTurner removed the :Distributed/Distributed A catch all label for anything in the Distributed Area. If you aren't sure, use this one. label Jul 29, 2022
@DaveCTurner DaveCTurner added the :Distributed/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) label Jul 29, 2022
@csoulios csoulios added v8.6.0 and removed v8.5.0 labels Sep 21, 2022
@kingherc kingherc added v8.7.0 and removed v8.6.0 labels Nov 16, 2022
@rjernst rjernst added v8.8.0 and removed v8.7.0 labels Feb 8, 2023
@gmarouli gmarouli added v8.9.0 and removed v8.8.0 labels Apr 26, 2023
@quux00 quux00 added v8.11.0 and removed v8.10.0 labels Aug 16, 2023
@mattc58 mattc58 added v8.12.0 and removed v8.11.0 labels Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>deprecation :Distributed/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) Team:Distributed Meta label for distributed team v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet