-
Notifications
You must be signed in to change notification settings - Fork 25.5k
No need to log unassigned shards on master shutdown #136149
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
base: main
Are you sure you want to change the base?
No need to log unassigned shards on master shutdown #136149
Conversation
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
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
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; | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this 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?
…nassigned-during-shutdown
Added a test in 5c9ac13. Thanks for the suggestion. |
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