Skip to content

DiscoveryNodes resolver resolves to all nodes if an empty list is given #52887

Closed
@hendrikmuhs

Description

@hendrikmuhs

This logic needs clarification and seems inconsistent:

DiscoveryNodes.resolver resolves an empty list of node id's to all nodes:

https://github.com/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/cluster/node/DiscoveryNodes.java#L329

This is in contrast to consumers of this API which explicitly check if the resolved nodes have length == 0, e.g.

https://github.com/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/action/support/tasks/TransportTasksAction.java#L241

Due to the implicit to all resolving this can never happen.

It seems to me that:

  • only null should trigger a resolve to all nodes but
  • an empty array should resolve to an empty array of nodes

This is potentially a tricky change. If you disagree, meaning if the current behavior is desired it would be good to clarify and document this.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions