Skip to content

Conversation

@zhubotang-wq
Copy link
Contributor

Relates ES-12080

In previous #135875, Reviewer correctly pointed out the handling of Index Routing Filters is absent in the current decider.

This PR addresses this deficiency by recuse the decider in event of the presence of index routing filters.

@zhubotang-wq zhubotang-wq requested a review from ywangd November 28, 2025 03:58
@zhubotang-wq zhubotang-wq added >refactoring :Distributed Coordination/Distributed A catch all label for anything in the Distributed Coordination area. Please avoid if you can. labels Nov 28, 2025
@elasticsearchmachine elasticsearchmachine added v9.3.0 Team:Distributed Coordination Meta label for Distributed Coordination team labels Nov 28, 2025
@elasticsearchmachine
Copy link
Collaborator

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

private List<RoutingNode> searchIier;

private void setup(Settings settings) {
private void setup(Settings clusterSettings, Supplier<Settings> indexSettings) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason why indexSettings is a Supplier is due to the need to defer retrieving DiscoveryNode reference until these variables are initialized.

String id = randomFrom(indexNodeOne.getId(), indexNodeTwo.getId(), searchNodeOne.getId(), searchNodeTwo.getId());
String hostName = randomFrom(
indexNodeOne.getHostName(),
indexNodeTwo.getHostName(),
searchNodeOne.getHostName(),
searchNodeTwo.getHostName()
);

Copy link
Member

Choose a reason for hiding this comment

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

That's OK though the filters and the decider behaviour do not depend on the filtered node IDs to match existing nodes.

Copy link
Member

@ywangd ywangd left a comment

Choose a reason for hiding this comment

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

LGTM

private List<RoutingNode> searchIier;

private void setup(Settings settings) {
private void setup(Settings clusterSettings, Supplier<Settings> indexSettings) {
Copy link
Member

Choose a reason for hiding this comment

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

That's OK though the filters and the decider behaviour do not depend on the filtered node IDs to match existing nodes.

final IndexMetadata indexMetadata = allocation.getClusterState().metadata().getProject(projectId).index(index);

if (hasIndexRoutingFilters(indexMetadata)) {
return allocation.decision(Decision.YES, NAME, "Decider is disabled.");
Copy link
Member

Choose a reason for hiding this comment

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

Can we be a bit more elaborative in the explanation string

Suggested change
return allocation.decision(Decision.YES, NAME, "Decider is disabled.");
return allocation.decision(Decision.YES, NAME, "Decider is disabled for index level allocation filters.");

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed Coordination/Distributed A catch all label for anything in the Distributed Coordination area. Please avoid if you can. >refactoring Team:Distributed Coordination Meta label for Distributed Coordination team v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants