Improve slow logging in MasterService#45086
Merged
DaveCTurner merged 6 commits intoelastic:masterfrom Aug 6, 2019
Merged
Conversation
Adds a tighter threshold for logging a warning about slowness in the `MasterService` instead of relying on the cluster service's 30-second warning threshold. This new threshold applies to the computation of the cluster state update in isolation, so we get a warning if computing a new cluster state update takes longer than 10 seconds even if it is subsequently applied quickly. It also applies independently to the length of time it takes to notify the cluster state tasks on completion of publication, in case any of these notifications holds up the master thread for too long. Relates elastic#45007
Collaborator
|
Pinging @elastic/es-distributed |
Member
Author
|
@elasticmachine please run elasticsearch-ci/2 (unrelated watcher failure it seems) |
ywelsch
reviewed
Aug 5, 2019
Contributor
ywelsch
left a comment
There was a problem hiding this comment.
Two minor comments, looking good o.w.
server/src/main/java/org/elasticsearch/cluster/service/ClusterService.java
Outdated
Show resolved
Hide resolved
| taskInputs.summary, | ||
| previousClusterState.nodes(), | ||
| previousClusterState.routingTable(), | ||
| previousClusterState.getRoutingNodes()), |
Contributor
There was a problem hiding this comment.
this call is potentially expensive (as it lazily builds the routing nodes), so I wonder if we should still guard this logging call with logger.isTraceEnabled()
Member
Author
There was a problem hiding this comment.
Ok, I think passing a message supplier is enough to avoid that, see 45c1919.
Member
Author
|
Failures look infrastructural. You do you, Jenkins. @elasticmachine please run elasticsearch-ci/bwc |
DaveCTurner
added a commit
to DaveCTurner/elasticsearch
that referenced
this pull request
Aug 6, 2019
Adds a tighter threshold for logging a warning about slowness in the `MasterService` instead of relying on the cluster service's 30-second warning threshold. This new threshold applies to the computation of the cluster state update in isolation, so we get a warning if computing a new cluster state update takes longer than 10 seconds even if it is subsequently applied quickly. It also applies independently to the length of time it takes to notify the cluster state tasks on completion of publication, in case any of these notifications holds up the master thread for too long. Relates elastic#45007
DaveCTurner
added a commit
that referenced
this pull request
Aug 6, 2019
Adds a tighter threshold for logging a warning about slowness in the `MasterService` instead of relying on the cluster service's 30-second warning threshold. This new threshold applies to the computation of the cluster state update in isolation, so we get a warning if computing a new cluster state update takes longer than 10 seconds even if it is subsequently applied quickly. It also applies independently to the length of time it takes to notify the cluster state tasks on completion of publication, in case any of these notifications holds up the master thread for too long. Relates #45007 Backport of #45086
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds a tighter threshold for logging a warning about slowness in the
MasterServiceinstead of relying on the cluster service's 30-second warningthreshold. This new threshold applies to the computation of the cluster state
update in isolation, so we get a warning if computing a new cluster state
update takes longer than 10 seconds even if it is subsequently applied quickly.
It also applies independently to the length of time it takes to notify the
cluster state tasks on completion of publication, in case any of these
notifications holds up the master thread for too long.
Relates #45007