Skip to content

org.elasticsearch.cluster.ClusterInfo#routingToDataPath should not use ShardRouting as a key #90109

@idegtiarenko

Description

@idegtiarenko

Description

It should be enough to have ShardId + nodeId key in routingToDataPath to find the necessary data path.
Changing the key would allow us to minimize the size of ClusterInfo size and find the data path when shard changes its status.

ClusterInfo might be sent over the wire when cluster allocation explain is executed with includeDiskInfo=true.
ShardRouting -> ShardId + nodeId conversion is trivial. The oposit would require additional information that could be faked.

Current key is also used in here:

builder.startObject("shard_paths");
{
for (Map.Entry<ShardRouting, String> c : this.routingToDataPath.entrySet()) {
builder.field(c.getKey().toString(), c.getValue());
}
}

where it produces a string with ShardRouting#shortSummary that is excessive and might be simplified to ShardId + nodeId as well

Metadata

Metadata

Assignees

Labels

:Distributed/AllocationAll issues relating to the decision making around placing a shard (both master logic & on the nodes)>tech-debtTeam:DistributedMeta label for distributed team.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions