Skip to content
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

Allocation Explain API default unassigned primary #108207

Closed
stefnestor opened this issue May 2, 2024 · 3 comments
Closed

Allocation Explain API default unassigned primary #108207

stefnestor opened this issue May 2, 2024 · 3 comments
Labels
:Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) >enhancement Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination.

Comments

@stefnestor
Copy link
Contributor

Description

👋 Would you kindly consider defaulting to a primary shard when the Allocation Explain API is ran without a request body?

E.g. 01611206 the no-request-body returned info about a replica which stated last_allocation_status: no_attempt (which made it sound like user needed to investigate software-hardware/logic setup) but attempting the same index's primary shard with an explicit request body reported no_valid_shard_copy.

AFAICT we generally assume users should resolve primaries first in all cases, so I believe it generally makes sense that IF no request body is provided our code's random shard to report on would default attempt to report on a primary.

@stefnestor stefnestor added >enhancement :Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. needs:triage Requires assignment of a team area label labels May 2, 2024
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine removed the needs:triage Requires assignment of a team area label label May 2, 2024
@idegtiarenko
Copy link
Contributor

I believe it is already prioritizing unassigned primaries if any:

if (request.useAnyUnassignedShard()) {
// If we can use any shard, return the first unassigned primary (if there is one) or the first unassigned replica (if not)
for (ShardRouting unassigned : allocation.routingNodes().unassigned()) {
if (foundShard == null || unassigned.primary()) {
foundShard = unassigned;
}
if (foundShard.primary()) {
break;
}
}

@idegtiarenko
Copy link
Contributor

Implemented in #76220

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) >enhancement Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination.
Projects
None yet
Development

No branches or pull requests

3 participants