8000 No need to log unassigned shards on master shutdown by ywangd · Pull Request #136149 · elastic/elasticsearch · GitHub
[go: up one dir, main page]

Skip to content

Conversation

ywangd
Copy link
Member
@ywangd ywangd commented Oct 8, 2025

When the master is shutting down, the project is likely being deleted. It is expected shards can become unassigned during this process. There is no need to log them.

Relates: ES-12842

When the master is shutting down, the project is likely being deleted.
It is expected shards can become unassigned during this process. There
is no need to log them.

Relates: ES-12842
@ywangd ywangd requested a review from DaveCTurner October 8, 2025 03:11
@ywangd ywangd added >non-issue :Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) v9.3.0 labels Oct 8, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine added the Team:Distributed Coordination Meta label for Distributed Coordination team label Oct 8, 2025
Comment on lines +568 to +571
if (clusterState.metadata().nodeShutdowns().contains(clusterState.nodes().getLocalNodeId())) {
// Master is shutting down, the project is likely being deleted. Shards can be unassigned and no need to report
return;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Logging on project deletion is one false postive that I noticed when enabling the logging in QA.

The other false positve is during project creation, e.g. a search shard can be unassigned because search node has not joined yet. This is not addressed in this PR. I don't have a great solution other than some time-based delay, i.e. no logging in the first 5min after node start.

I'd like to fix the issue on project deletion first since it is the more noisy case. I also added input index in the log which might be useful as a hint to decide whether to log or not for project creation if we observe some valid pattern in QA.

Copy link
Contributor
@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

Could we have coverage for this branch in testLogAllocationExplainForUnassigned too?

@ywangd
Copy link
Member Author
ywangd commented Oct 8, 2025

Added a test in 5c9ac13. Thanks for the suggestion.

@ywangd ywangd requested a review from DaveCTurner October 8, 2025 23:15
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) >non-issue 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
0