-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
chore(ae): add more logging #21381
chore(ae): add more logging #21381
Conversation
tsdb.Engine.IsIdle and tsdb.Shard.Digest now take a boolean parameter, isLogged. If this is true, the engine will use trace-logging and report which checks are causing the engine not to be idle. tsdb.Shard exposes a funcion LoggedIsIdle() which calls tsdb.Engine.IsIdle(true). This is only used in calls from the anti-entropy service in Enterprise.
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.
The main logic makes sense to me, some nitpicky questions
246c08f
to
33aecc5
Compare
Co-authored-by: David Norton <dgnorton@gmail.com>
cc09142
to
2570fe7
Compare
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.
Some small suggestions but LGTM overall
tsdb/shard.go
Outdated
} | ||
|
||
// Make sure the shard is idle/cold. (No use creating a digest of a | ||
// hot shard that is rapidly changing.) | ||
if !engine.IsIdle() { | ||
return nil, 0, ErrShardNotIdle | ||
if state, reason := engine.IsIdle(); !state { |
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.
if state, reason := engine.IsIdle(); !state { | |
if isIdle, reason := engine.IsIdle(); !isIdle { |
Easier for me to understand, the current way took my brain a bit to process
tsdb.Engine.IsIdle and tsdb.Engine.Digest now return a reason string for why the engine & shard are not idle. Callers can then use this string for logging, if desired. The returned reason does not allocate memory, so the caller may want to add the shard ID and path for more information in the log. This is intended to be used in calls from the anti-entropy service in Enterprise. (cherry picked from commit bf45841)
tsdb.Engine.IsIdle and tsdb.Engine.Digest now return a reason string for why the engine & shard are not idle. Callers can then use this string for logging, if desired. The returned reason does not allocate memory, so the caller may want to add the shard ID and path for more information in the log. This is intended to be used in calls from the anti-entropy service in Enterprise. (cherry picked from commit bf45841) fixes #21448
tsdb.Engine.IsIdle and tsdb.Engine.Digest now return a reason string for why the engine & shard are not idle. Callers can then use this string for logging, if desired. The returned reason does not allocate memory, so the caller may want to add the shard ID and path for more information in the log. This is intended to be used in calls from the anti-entropy service in Enterprise. (cherry picked from commit bf45841) Fixes #21449
tsdb.Engine.IsIdle and tsdb.Engine.Digest now return a reason string for why the engine & shard are not idle. Callers can then use this string for logging, if desired. The returned reason does not allocate memory, so the caller may want to add the shard ID and path for more information in the log. This is intended to be used in calls from the anti-entropy service in Enterprise. (cherry picked from commit bf45841) Fixes #21449
tsdb.Engine.IsIdle and tsdb.Engine.Digest now return a reason string for why the engine & shard are not idle. Callers can then use this string for logging, if desired. The returned reason does not allocate memory, so the caller may want to add the shard ID and path for more information in the log. This is intended to be used in calls from the anti-entropy service in Enterprise. (cherry picked from commit bf45841) fixes #21448 (cherry picked from commit c8da9ba)
tsdb.Engine.IsIdle and tsdb.Engine.Digest now return a reason string for why the engine & shard are not idle.
Callers can then use this string for logging, if desired. The returned reason does not allocate memory, so the
caller may want to add the shard ID and path for more information in the log. This is intended to be used in
calls from the anti-entropy service in Enterprise.
Closes #21380