forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: fix and simplify session tracing span mgmt
Before this patch, session tracing was broken in two ways: - it leaked a span, corresponding to the transaction that was ongoing when session tracing is initiated. Session tracing was replacing that span in the connection's tracking, and so nobody was ever Finish()ing it. - it exposed a span to use-after-finish. This is the span that replaced the span discussed above. When session tracing is initiated in a transaction, it overwrote the txn's span. When session tracing was finished, it finished that span. But, in case tracing is finished in the same txn as the one it started in, then that span is still referenced by the connection. This patch fixes these issues and also simplifies how session tracing works. We do away with the special handling of the transaction during which tracing starts. Instead, we just give this transaction a span inheriting from the same recording span that future transactions will inherit from. The SessionTracing struct gets out of the business of owning any spans. Release note: None
- Loading branch information
1 parent
297a776
commit a6558fd
Showing
2 changed files
with
34 additions
and
44 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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