sql: trace meta2 scans made by crdb_internal.probe_ranges#81107
Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom May 12, 2022
Merged
sql: trace meta2 scans made by crdb_internal.probe_ranges#81107craig[bot] merged 1 commit intocockroachdb:masterfrom
craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
Member
tbg
approved these changes
May 9, 2022
| // Trace the query to meta2. Return it as part of the error string if the query fails. | ||
| // This improves observability into a meta2 outage. We expect crdb_internal.probe_range | ||
| // to be available, unless meta2 is down. | ||
| meta2Ctx, sp := tracing.EnsureChildSpan( |
Member
There was a problem hiding this comment.
Preference to rewrite as follows, that way there is only ever one ctx in scope and it's the right one:
var ranges []WhateverTypeThisIs
{
ctx, sp := tracing.EnsureChildSpan(...)
// ...
var err error
ranges, err = kvclient.ScanMetaKVs(meta2Ctx, ...)
if err != nil { ... }
}5579cdc to
f6a55bb
Compare
Collaborator
Author
|
TTFR! |
Collaborator
Author
|
bors r+ |
With this commit, CRDB traces the meta2 scan made by crdb_internal.probe_ranges. If the scan fails, the trace is attached to the error returned to the SQL client. This way, outages involving a down meta2 range are observable. According to my testing, meta2 is the only system range that can make crdb_internal.probe_ranges unavailable. As a result, with this commit, we should get a trace of a query to the unavailable range, regardless of which range is unavailable, either in the SQL table output of crdb_internal.probe_ranges or in an error string. Release note. None.
f6a55bb to
fec45b8
Compare
Contributor
|
Canceled. |
Collaborator
Author
|
bors r+ |
Contributor
|
Build succeeded: |
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.
sql: trace meta2 scans made by crdb_internal.probe_ranges
With this commit, CRDB traces the meta2 scan made by
crdb_internal.probe_ranges. If the scan fails, the trace is attached to the
error returned to the SQL client. This way, outages involving a down meta2
range are observable.
According to my testing, meta2 is the only system range that can make
crdb_internal.probe_ranges unavailable. As a result, with this commit, we
should get a trace of a query to the unavailable range, regardless of which
range is unavailable, either in the SQL table output of
crdb_internal.probe_ranges or in an error string.
Release note. None.
This is based on some thinking & testing I did at #79546 (comment).
With this commit, we get:
If run a test like this:
Without this commit, we just get: