-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Improve Node Shutdown Observability #78727
Merged
elasticsearchmachine
merged 9 commits into
elastic:master
from
gwbrown:decom/better-diagnostics
Oct 8, 2021
Merged
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1e60cef
Increase node shutdown logging level when stalled
gwbrown e781b81
Add allocation explanation to STALLED response
gwbrown e34a533
Adjust logging levels per review
gwbrown 64055cb
Merge branch 'master' into decom/better-diagnostics
gwbrown 37e0250
Include all SingleNodeShutdownMetadata fields in logs
gwbrown b637514
Depluralize `node_shutdown_decisions` per review
gwbrown 57756c2
Merge branch 'master' into decom/better-diagnostics
gwbrown 069079b
Repluralize node_allocation_decisions when we're actually reading fro…
gwbrown bb7660c
Merge branch 'master' into decom/better-diagnostics
gwbrown File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -262,17 +262,15 @@ static ShutdownShardMigrationStatus shardMigrationStatus( | |
return hasShardCopyOnOtherNode == false; | ||
}) | ||
.peek(pair -> { | ||
if (logger.isTraceEnabled()) { // don't serialize the decision unless we have to | ||
logger.trace( | ||
"node [{}] shutdown of type [{}] stalled: found shard [{}][{}] from index [{}] with negative decision: [{}]", | ||
nodeId, | ||
shutdownType, | ||
pair.v1().getId(), | ||
pair.v1().primary() ? "primary" : "replica", | ||
pair.v1().shardId().getIndexName(), | ||
Strings.toString(pair.v2()) | ||
); | ||
} | ||
logger.info( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we hit this every 10 seconds for 30 minutes, that's roughly 180 times, are we okay with that amount of logging? That seems a little too excessive to me. Perhaps it would be better to put this at |
||
"node [{}] shutdown of type [{}] stalled: found shard [{}][{}] from index [{}] with negative decision: [{}]", | ||
nodeId, | ||
shutdownType, | ||
pair.v1().getId(), | ||
pair.v1().primary() ? "primary" : "replica", | ||
pair.v1().shardId().getIndexName(), | ||
Strings.toString(pair.v2()) | ||
); | ||
}) | ||
.findFirst(); | ||
|
||
|
@@ -287,6 +285,7 @@ static ShutdownShardMigrationStatus shardMigrationStatus( | |
} else if (unmovableShard.isPresent()) { | ||
// We found a shard that can't be moved, so shard relocation is stalled. Blame the unmovable shard. | ||
ShardRouting shardRouting = unmovableShard.get().v1(); | ||
ShardAllocationDecision decision = unmovableShard.get().v2(); | ||
|
||
return new ShutdownShardMigrationStatus( | ||
SingleNodeShutdownMetadata.Status.STALLED, | ||
|
@@ -296,7 +295,8 @@ static ShutdownShardMigrationStatus shardMigrationStatus( | |
shardRouting.shardId().getId(), | ||
shardRouting.primary() ? "primary" : "replica", | ||
shardRouting.index().getName() | ||
).getFormattedMessage() | ||
).getFormattedMessage(), | ||
decision | ||
); | ||
} else { | ||
return new ShutdownShardMigrationStatus(SingleNodeShutdownMetadata.Status.IN_PROGRESS, totalRemainingShards); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Super minor nit, but since this is the top-level decision first rather than a plain list (it definitely has multiple sub parts though), can this be 'node_allocation_decision'?
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.
Done and good catch!