engine: plumb a Context into MVCC#5255
Conversation
|
Reviewed 35 of 35 files at r1. Comments from the review on Reviewable.io |
|
LGTM Review status: all files reviewed at latest revision, 3 unresolved discussions. storage/replica.go, line 1516 [r1] (raw file): storage/replica_command.go, line 52 [r1] (raw file): I feel like maybe we should be passing the context around and getting the span from the context when we need it. (Didn't I just argue against that in #5184? I think the difference is that the span is a global/contextual thing while the command ID and index are more part of the semantics of the particular function.) One potential reason to pass the context when all we need is a span: the storage/engine/mvcc.go, line 50 [r1] (raw file): Comments from the review on Reviewable.io |
|
Review status: all files reviewed at latest revision, 3 unresolved discussions. storage/replica_command.go, line 52 [r1] (raw file): Comments from the review on Reviewable.io |
|
Review status: all files reviewed at latest revision, 3 unresolved discussions, some commit checks failed. storage/replica.go, line 1516 [r1] (raw file): storage/replica_command.go, line 52 [r1] (raw file): I've also wanted to hook tracing up with logging, but it didn't seem important enough so far. storage/engine/mvcc.go, line 50 [r1] (raw file): I think there's a good solution once we've figured out how to combine logging and tracing. I'll suggest a PR shortly - the idea would be that all (usual) logging calls take a context which will log to a span contained in the trace (if any) as well. Additionally, we have Comments from the review on Reviewable.io |
| // back with the response. This is more expensive, but then again, | ||
| // those are individual requests traced by users, so they can be. | ||
| if sp.BaggageItem(tracing.Snowball) != "" { | ||
| sp.LogEvent("delegating to snowball tracing") |
dbdc4b7 to
d18ac30
Compare
This will make it much easier to debug those performance issues which can be triggered through `EXPLAIN (TRACE) <STMT>` in a development setting. There currently is no good story for different verbosity levels, so the goal is not to place regular tracepoints around but to have the infrastructure for ad-hoc debugging performance issues in place. I imagine this could be useful for issues such as cockroachdb#4386 or cockroachdb#5981.
|
Resuscitated, PTAL. Don't look at the diff. I suggest skipping lightly over |
|
One question is whether the uses of Review status: 0 of 33 files reviewed at latest revision, 4 unresolved discussions. Comments from Reviewable |
|
I recall initially wanting to plumb everywhere, but it didn't really make a whole lot of sense. There might be the odd Context that should be a |
|
Thanks for the quick review, @petermattis. |
This will make it much easier to debug those performance issues which can be
triggered through
EXPLAIN (TRACE) <STMT>in a development setting.There currently is no good story for different verbosity levels, so the goal is
not to place regular tracepoints around but to have the infrastructure for
ad-hoc debugging performance issues in place. I imagine this could be useful
for issues such as #4386 or #5981.
This change is