-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Improve Snapshot Logging #137470
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 Snapshot Logging #137470
Changes from all commits
cb318cb
229e3ab
053d536
741ed12
2e0f6b5
2cc1aa5
d8d949a
ced5d1e
9e4ba81
961e9e9
2065287
a5652f8
1e9a0ab
84e916b
9163bf6
ef3f972
48baaeb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ | |
| import org.elasticsearch.common.Strings; | ||
| import org.elasticsearch.common.settings.ClusterSettings; | ||
| import org.elasticsearch.common.settings.Setting; | ||
| import org.elasticsearch.common.time.DateFormatter; | ||
| import org.elasticsearch.common.util.concurrent.ConcurrentCollections; | ||
| import org.elasticsearch.core.TimeValue; | ||
| import org.elasticsearch.index.shard.ShardId; | ||
|
|
@@ -44,6 +45,7 @@ public class SnapshotShutdownProgressTracker { | |
| ); | ||
|
|
||
| private static final Logger logger = LogManager.getLogger(SnapshotShutdownProgressTracker.class); | ||
| private static final DateFormatter DATE_TIME_FORMATTER = DateFormatter.forPattern("strict_date_optional_time"); | ||
|
Contributor
Author
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. Using the same approach as here
Contributor
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. I haven't delved into the possibilities, but looking at the superficial outcome a log message from the testing you added looks like Specifically,
Contributor
Author
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. N.B I used N.B The
Contributor
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. Works for me, thanks 👍 |
||
|
|
||
| private final Supplier<String> getLocalNodeId; | ||
| private final Consumer<Logger> logIndexShardSnapshotStatuses; | ||
|
|
@@ -136,15 +138,17 @@ private void logProgressReport() { | |
| logger.info( | ||
| """ | ||
| Current active shard snapshot stats on data node [{}]. \ | ||
| Node shutdown cluster state update received at [{} millis]. \ | ||
| Finished signalling shard snapshots to pause at [{} millis]. \ | ||
| Node shutdown cluster state update received at [{} UTC]. \ | ||
| Finished signalling shard snapshots to pause at [{} UTC]. \ | ||
| Time between the node shutdown cluster state update and signalling shard snapshots to pause is [{} millis]. \ | ||
| Number shard snapshots running [{}]. \ | ||
| Number shard snapshots waiting for master node reply to status update request [{}] \ | ||
| Shard snapshot completion stats since shutdown began: Done [{}]; Failed [{}]; Aborted [{}]; Paused [{}]\ | ||
| """, | ||
| getLocalNodeId.get(), | ||
| shutdownStartMillis, | ||
| shutdownFinishedSignallingPausingMillis, | ||
| DATE_TIME_FORMATTER.formatMillis(shutdownStartMillis), | ||
| DATE_TIME_FORMATTER.formatMillis(shutdownFinishedSignallingPausingMillis), | ||
| shutdownFinishedSignallingPausingMillis - shutdownStartMillis, | ||
| numberOfShardSnapshotsInProgressOnDataNode.get(), | ||
| shardSnapshotRequests.size(), | ||
| doneCount.get(), | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
Improving the log. Example:
...took [1.4s/1400ms]