Skip to content

Ensuring that the ShrinkAction does not hang if total shards per node is too low#76732

Merged
masseyke merged 4 commits intoelastic:masterfrom
masseyke:fix/prevent-blocking-shrink
Aug 20, 2021
Merged

Ensuring that the ShrinkAction does not hang if total shards per node is too low#76732
masseyke merged 4 commits intoelastic:masterfrom
masseyke:fix/prevent-blocking-shrink

Conversation

@masseyke
Copy link
Copy Markdown
Member

We added configuration to AllocateAction to set the total shards per node property on the index. This makes it possible that a user could set this to a value lower than the total number of shards in the index that is about to be shrunk, meaning that all of the shards could not be moved to a single node in the ShrinkAction. This commit sets the total shards per node property to -1 (unlimited) in the ShrinkAction to avoid this.
Relates to #44070

@masseyke masseyke added the :Data Management/ILM+SLM DO NOT USE. Use ":StorageEngine/ILM" or ":Distributed Coordination/SLM" instead. label Aug 19, 2021
@elasticmachine elasticmachine added the Team:Data Management (obsolete) DO NOT USE. This team no longer exists. label Aug 19, 2021
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-features (Team:Core/Features)

@masseyke
Copy link
Copy Markdown
Member Author

This is related to this PR: #76134

Copy link
Copy Markdown
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

Generally LGTM, I left one minor comment, thanks for fixing this!

Settings settings = Settings.builder()
.put(IndexMetadata.INDEX_ROUTING_REQUIRE_GROUP_SETTING.getKey() + "_id", nodeId.get()).build();
.put(IndexMetadata.INDEX_ROUTING_REQUIRE_GROUP_SETTING.getKey() + "_id", nodeId.get())
.put(ShardsLimitAllocationDecider.INDEX_TOTAL_SHARDS_PER_NODE_SETTING.getKey(), -1).build();
Copy link
Copy Markdown
Member

@dakrone dakrone Aug 19, 2021

Choose a reason for hiding this comment

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

I think rather than setting this explicitly to -1, we might be better if we did:

Suggested change
.put(ShardsLimitAllocationDecider.INDEX_TOTAL_SHARDS_PER_NODE_SETTING.getKey(), -1).build();
.putNull(ShardsLimitAllocationDecider.INDEX_TOTAL_SHARDS_PER_NODE_SETTING.getKey()).build();

Since the default value is -1 (rather than setting it to that explicitly)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Makes sense. Done.

@masseyke masseyke merged commit 0aab3c0 into elastic:master Aug 20, 2021
masseyke added a commit to masseyke/elasticsearch that referenced this pull request Aug 20, 2021
… is too low (elastic#76732)

We added configuration to AllocateAction to set the total shards per node property on the index. This makes it possible that a user could set this to a value lower than the total number of shards in the index that is about to be shrunk, meaning that all of the shards could not be moved to a single node in the ShrinkAction. This commit unsets the total shards per node property so that we fall back to the default value (-1, unlimited) in the ShrinkAction to avoid this.
Relates to elastic#44070
masseyke added a commit that referenced this pull request Aug 20, 2021
… is too low (#76732) (#76780)

This is a backport of #76732. We added configuration to AllocateAction to set the total shards
per node property on the index. This makes it possible that a user could set this to a value lower
than the total number of shards in the index that is about to be shrunk, meaning that all of the
shards could not be moved to a single node in the ShrinkAction. This commit unsets the total
shards per node property so that we fall back to the default value (-1, unlimited) in the
ShrinkAction to avoid this.
Relates to #44070
@masseyke masseyke deleted the fix/prevent-blocking-shrink branch November 2, 2021 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Data Management/ILM+SLM DO NOT USE. Use ":StorageEngine/ILM" or ":Distributed Coordination/SLM" instead. Team:Data Management (obsolete) DO NOT USE. This team no longer exists. v8.0.0-alpha2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow adjustment of index resource constraints in ILM phase transitions

5 participants