-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Reduce state size in awareness allocation decider #70063
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
Reduce state size in awareness allocation decider #70063
Conversation
Today the awareness allocation decider computes the number of nodes and shards in each zone, even though it only needs to know the names of the zones and the number of shards in the current zone. This commit drops the unnecessary state in the computation.
|
Pinging @elastic/es-distributed (Team:Distributed) |
henningandersen
left a comment
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.
LGTM.
| } | ||
| final RoutingNode currentNode = allocation.routingNodes().node( | ||
| shardRouting.relocating() ? shardRouting.relocatingNodeId() : shardRouting.currentNodeId()); | ||
| if (currentAttributeValue.equals(currentNode.node().getAttributes().get(awarenessAttribute)) == false) { |
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.
nit: Can we perhaps rename currentAttributeValue and shardsForCurrentAttributeValue to something like targetAttributeValue and shardsForTargetAttributeValue? That would help distinguish currentNode and currentAttributeValue (which are from different nodes).
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.
Sure, see d9703a0.
Today the awareness allocation decider computes the number of nodes and shards in each zone, even though it only needs to know the names of the zones and the number of shards in the current zone. This commit drops the unnecessary state in the computation.
Today the awareness allocation decider computes the number of nodes and
shards in each zone, even though it only needs to know the names of the
zones and the number of shards in the current zone. This commit drops
the unnecessary state in the computation.