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

Index Settings: Auto expand replica enabled indices ignore number of replica updates without telling the user #27835

Open
spinscale opened this issue Dec 15, 2017 · 9 comments
Labels
>bug :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

Comments

@spinscale
Copy link
Contributor

Elasticsearch version (bin/elasticsearch --version): 6.0.0

Description of the problem including expected versus actual behavior:

Steps to reproduce:

Ran this on a two node cluster (so auto expanding works)

DELETE foo

PUT foo
{
  "settings": {
    "index.auto_expand_replicas" : "0-all"
  }
}

GET _cat/shards

# this is acknowledged, but the setting is not updated due to the auto expanding replicas
PUT foo/_settings
{
  "settings": {
    "index.number_of_replicas" : 2
  }
}

# returns 1
GET foo/_settings?filter_path=**.number_of_replicas

# state is green, as auto expand setting is still in place
GET _cat/indices/foo

The behaviour looks correct to me, but returning an error on the update indices settings call makes sense to me.

@pickypg
Copy link
Member

pickypg commented Dec 18, 2017

I kind of wonder if we should just deprecate auto_expand_replicas and add its functionality to number_of_replicas instead?

@GlenRSmith
Copy link
Contributor

@pickypg If we did that, what would be reported on inspection of the index settings number_of_replicas?

@pickypg
Copy link
Member

pickypg commented Dec 21, 2017

@GlenRSmith The value that is set, which could continue to default to 1, or possibly we could change the default to "0-1". Because it's just a setting and not a live representation of how many replicas are allocated, I don't think there's much risk with adding functionality to it by merging it with auto_expand_replicas.

@GlenRSmith
Copy link
Contributor

@pickypg Currently, if you set auto_expand_replicas, number_of_replicas will report the current target count. If these are merged, number_of_replicas will have to report either the expand setting or the target, as is currently reported, so it seems to me that such a change will result in information loss.

@pickypg
Copy link
Member

pickypg commented Dec 22, 2017

@GlenRSmith I think it's a bug that the value reported by number_of_replicas changes. Under normal usage of number_of_replicas, it doesn't change based on how the cluster is actually behaving and I cannot think of any other setting that behaves that way either. Checking the _settings for state seems like a very bad idea to me.

It's easy to see the number of allocated replicas via /_cat/indices or /_cat/shards (or even just /_shard_stores for unallocated shards and specifying the ?status=green as desired)

@PnPie
Copy link
Contributor

PnPie commented Dec 31, 2017

I see that when auto_expand_replicas is enabled, the way we achieve "automatically update replicas number" is to re-set it's number_of_replicas settings (IndexMetaData.SETTING_NUMBER_OF_REPLICAS) and then kick off a reroute. So this is why we get the "current replicas number state" while hitting _settings, because the setting itself changes all the time when auto_expand_replicas enabled.

So I agree with @pickypg and I also think it's better to merge auto_expand_replicas into number_of_replicas as these 2 settings are kind of one thing and especially when auto_expand_replicas enabled, seems number_of_replicas doesn't make any sense.

@rjernst rjernst added the Team:Core/Infra Meta label for core/infra team label May 4, 2020
@rjernst rjernst added the needs:triage Requires assignment of a team area label label Dec 3, 2020
@gwbrown gwbrown removed the help wanted adoptme label Dec 16, 2020
@gwbrown
Copy link
Contributor

gwbrown commented Dec 18, 2020

I'm labeling this team-discuss because the problem is clear, but it does not seem that a solid conclusion was reached about what to do about it.

@gwbrown gwbrown added team-discuss and removed needs:triage Requires assignment of a team area label labels Dec 18, 2020
@rjernst
Copy link
Member

rjernst commented Apr 6, 2021

I'm relabeling this issue for the distributed team to decide any future action on, since this is not a settings infrastructure issue.

@rjernst rjernst added :Distributed/Distributed A catch all label for anything in the Distributed Area. If you aren't sure, use this one. and removed :Core/Infra/Settings Settings infrastructure and APIs team-discuss labels Apr 6, 2021
@elasticmachine elasticmachine added Team:Distributed Meta label for distributed team and removed Team:Core/Infra Meta label for core/infra team labels Apr 6, 2021
@elasticmachine
Copy link
Collaborator

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

DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this issue May 19, 2021
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
@pxsalehi pxsalehi added :Distributed/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) and removed :Distributed/Distributed A catch all label for anything in the Distributed Area. If you aren't sure, use this one. labels Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :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
Projects
None yet
Development

No branches or pull requests

9 participants