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

Allow re-allocation of replica shards on nodes during shutdown replacement #79171

Merged

Conversation

dakrone
Copy link
Member

@dakrone dakrone commented Oct 14, 2021

This commit allows replica shards that have existing data on disk to be re-allocated to the target
of a "REPLACE" type node shutdown. Prior to this if the target node of a shutdown were to restart,
the replicas would not be allowed to be allocated even if their data existed on disk.

Relates to #70338 as a follow-up to #76247

This commit allows replica shards that have existing data on disk to be re-allocated to the target
of a "REPLACE" type node shutdown. Prior to this if the target node of a shutdown were to restart,
the replicas would not be allowed to be allocated even if their data existed on disk.

Relates to elastic#70338 as a follow-up to elastic#76247
@dakrone dakrone added v8.0.0 :Core/Infra/Node Lifecycle Node startup, bootstrapping, and shutdown v7.16.0 labels Oct 14, 2021
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Oct 14, 2021
@elasticmachine
Copy link
Collaborator

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

@dakrone dakrone changed the title All re-allocation of replica shards on nodes during shutdown replacement Allow re-allocation of replica shards on nodes during shutdown replacement Oct 14, 2021
Copy link
Contributor

@henningandersen henningandersen left a comment

Choose a reason for hiding this comment

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

LGTM.

final String nodeA = internalCluster().startNode();
final String nodeAId = getNodeId(nodeA);
createIndex("myindex", Settings.builder().put("index.number_of_shards", 1).put("index.number_of_replicas", 1).build());
ensureYellow("myindex");
Copy link
Contributor

Choose a reason for hiding this comment

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

I think ensureYellow is unnecessary, since create will wait for one active shard?

Copy link
Member Author

@dakrone dakrone Oct 15, 2021

Choose a reason for hiding this comment

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

yeah, it is, but it's also being explicit in the test so that whoever is reading it knows what state we expect to have the index in, so I'd prefer to keep it in unless you have strong feelings about it :)

@dakrone dakrone merged commit dbb1e49 into elastic:master Oct 15, 2021
@dakrone dakrone deleted the node-replace-allow-replica-reallocation branch October 15, 2021 14:47
dakrone added a commit to dakrone/elasticsearch that referenced this pull request Oct 15, 2021
…ement (elastic#79171)

This commit allows replica shards that have existing data on disk to be re-allocated to the target
of a "REPLACE" type node shutdown. Prior to this if the target node of a shutdown were to restart,
the replicas would not be allowed to be allocated even if their data existed on disk.

Relates to elastic#70338 as a follow-up to elastic#76247
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
7.x

elasticsearchmachine pushed a commit that referenced this pull request Oct 15, 2021
…ement (#79171) (#79266)

This commit allows replica shards that have existing data on disk to be re-allocated to the target
of a "REPLACE" type node shutdown. Prior to this if the target node of a shutdown were to restart,
the replicas would not be allowed to be allocated even if their data existed on disk.

Relates to #70338 as a follow-up to #76247
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Node Lifecycle Node startup, bootstrapping, and shutdown >non-issue Team:Core/Infra Meta label for core/infra team v7.16.0 v8.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants