Skip to content

Conversation

@DaveCTurner
Copy link
Contributor

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.
@DaveCTurner DaveCTurner added :Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) >refactoring v8.0.0 v7.13.0 labels Mar 8, 2021
@elasticmachine elasticmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Mar 8, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

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 RoutingNode currentNode = allocation.routingNodes().node(
shardRouting.relocating() ? shardRouting.relocatingNodeId() : shardRouting.currentNodeId());
if (currentAttributeValue.equals(currentNode.node().getAttributes().get(awarenessAttribute)) == false) {
Copy link
Contributor

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).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, see d9703a0.

@DaveCTurner DaveCTurner merged commit 65191d0 into elastic:master Mar 16, 2021
@DaveCTurner DaveCTurner deleted the 2021-03-08-awareness-allocator-cleanup branch March 16, 2021 12:01
DaveCTurner added a commit that referenced this pull request Mar 16, 2021
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.
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) >refactoring Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v7.13.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants