-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Introduce separate shard limit for frozen shards #71392
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
Introduce separate shard limit for frozen shards #71392
Conversation
Frozen indices (partial searchable snapshots) require less heap per shard and the limit can therefore be raised for those. We pick 3000 frozen shards per frozen data node, since we think 2000 is reasonable to use in production. Relates elastic#71042
Pinging @elastic/es-distributed (Team:Distributed) |
Pinging @elastic/es-core-features (Team:Core/Features) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so well executed, all I have are small nits. Thanks for making this one so easy to review. My small nits don’t require another round.
private Optional<String> checkShardLimit(int newShards, int newFrozenShards, ClusterState state) { | ||
// we verify the two limits independently. This also means that if they have mixed frozen and other data-roles nodes, such a mixed | ||
// node can have both 1000 normal and 3000 frozen shards. This is the trade-off to keep the simplicity of the counts. We advocate | ||
// against such mixed nodes for production use anyway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with this, good comment.
|
||
private static boolean hasFrozen(DiscoveryNode node) { | ||
final List<DiscoveryNodeRole> dataRoles = | ||
node.getRoles().stream().filter(DiscoveryNodeRole::canContainData).collect(Collectors.toUnmodifiableList()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about return node.getRoles().contains(DiscoveryNodeRole.DATA_FROZEN_NODE_ROLE);
? (And sorry if that doesn’t quite compile, I’m reviewing from my iPad, so no IDE support.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, much nicer and did compile, changed in 67e92fd
|
||
private static boolean hasNonFrozen(DiscoveryNode node) { | ||
final List<DiscoveryNodeRole> dataRoles = | ||
node.getRoles().stream().filter(DiscoveryNodeRole::canContainData).collect(Collectors.toUnmodifiableList()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return node.getRoles().stream().anyMatch(r -> r.canContainData() && r !=DiscoveryNodeRole.DATA_FROZEN_NODE_ROLE);
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This suggested predicate almost exactly matches the name of the method (it has a non-frozen data role), while the current implementation requires a little bit of though. And we can avoid the unnecessary materialization of a collection, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that is nicer, added in 67e92fd
@elasticmachine update branch |
@elasticmachine update branch |
Frozen indices (partial searchable snapshots) require less heap per shard and the limit can therefore be raised for those. We pick 3000 frozen shards per frozen data node, since we think 2000 is reasonable to use in production. Relates elastic#71042 and elastic#34021
Frozen indices created on 7.12 would not belong to the frozen shard limit group, now we convert them when last node is upgraded. Relates elastic#71392
If master ends up on a newer version than other cluster members, we cannot apply the new index setting for shard limits. We skip doing so for now. Relates #71392
Frozen indices created on 7.12 would not belong to the frozen shard limit group, now we convert them when last node is upgraded. Relates #71392
Frozen indices created on 7.12 would not belong to the frozen shard limit group, now we convert them when last node is upgraded. Relates #71392
Frozen indices (partial searchable snapshots) require less heap per
shard and the limit can therefore be raised for those. We pick 3000
frozen shards per frozen data node, since we think 2000 is reasonable
to use in production.
Relates #71042 and #34021