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

Nodes drop their copy of auto-expanded data when coming up, only to sync it again #1873

Closed
avar opened this issue Apr 18, 2012 · 5 comments
Closed
Assignees
Labels
:Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) >enhancement high hanging fruit

Comments

@avar
Copy link

avar commented Apr 18, 2012

When you have an index with index.auto_expand_replicas=0-all running on 3 nodes and you bring down one node the number of replicas will be reduced by the master from 2 to 1. Then when the node that just went down comes up again ElasticSearch on that node will will:

  1. Go up, notice that the number of replicas for that index is 1, and promptly drop its own data as redundant
  2. The master will notice that it has a new node in the cluster, set the number of replicas to 2.
  3. The node that just dropped its data will now have the data it just dropped re-synced to it.

Instead ElasticSearch should:

  1. Go up, wait for the master to adjust the number of replicas if needed
  2. Only after that's done drop anything, if needed.
  3. Not re-sync any data since it didn't drop the data in the brief interim when the master was adjusting the number of replicas from 1 to 2.

This'll aid recovery time where you have a setup where a relatively small index is available on all the nodes for capacity reasons, and you bring up a new node that should serve search requests right away.

@clintongormley
Copy link
Contributor

Yeah, I was just hit by this one too. Wonder what happens if you disable reallocation before shutting down?

@martijnvg
Copy link
Member

Perhaps scheduling the deletion of the physical shard files when a shard is no longer allocated on a node can help here. Then there is time window the master node can react the the node rejoining and the deletion of physical shard files can be cancelled.

@portante
Copy link

portante commented Mar 7, 2017

@ywelsch, @clintongormley, is this issue going to be addressed for 2.4.x any time soon? Is this issue a problem with 5.x?

@lukas-vlcek
Copy link
Contributor

@portante I just tested with ES v5.2.2 and I am able to replicate this issue.

jcantrill added a commit to jcantrill/openshift-ansible that referenced this issue Mar 15, 2017
@lcawl lcawl added :Distributed Indexing/Distributed A catch all label for anything in the Distributed Area. Please avoid if you can. and removed :Allocation labels Feb 13, 2018
@ywelsch ywelsch added :Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) and removed :Distributed Indexing/Distributed A catch all label for anything in the Distributed Area. Please avoid if you can. labels Mar 26, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

ywelsch added a commit that referenced this issue May 7, 2018
Auto-expands replicas in the same cluster state update (instead of a follow-up reroute) where nodes are added or removed.

Closes #1873, fixing an issue where nodes drop their copy of auto-expanded data when coming up, only to sync it again later.
ywelsch added a commit that referenced this issue May 7, 2018
Auto-expands replicas in the same cluster state update (instead of a follow-up reroute) where nodes are added or removed.

Closes #1873, fixing an issue where nodes drop their copy of auto-expanded data when coming up, only to sync it again later.
colings86 pushed a commit that referenced this issue May 8, 2018
Auto-expands replicas in the same cluster state update (instead of a follow-up reroute) where nodes are added or removed.

Closes #1873, fixing an issue where nodes drop their copy of auto-expanded data when coming up, only to sync it again later.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) >enhancement high hanging fruit
Projects
None yet
Development

No branches or pull requests

10 participants