Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…db#72443 72122: sql: fix and simplify session tracing span mgmt r=andreimatei a=andreimatei 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 72268: roachtest: pass option to sequelize test correctly r=ajstorm a=rafiss fixes cockroachdb#71976 Release note: None 72416: server: Return permission error if one occurs for Events endpoint r=nathanstilwell a=nathanstilwell Events in DB Console (`/#/events`) would show an internal server error to the user if they did not have admin permissions to view events. The error logged in the server is indeed a permissions error, but this is confusing to the user. To accurately show a permission error on the FrontEnd, I added an AND statement to the Events endpoint to only return a server error if an error exists and is not a permission error. Release note (ui change): Node events will now display a permission error rather than an internal server error when user does not have admin privileges to view events. 72443: tracing: fix tracer closing r=andreimatei a=andreimatei ContextWithRecording span was closing the passed-in Tracer, which is completely wrong. This has been broken since a long time ago; the function originally was written to create its own Tracer but then changed to take in a Tracer and the bad close remained. As a practical consequence, tracing to external tracers stopped whenever one of the debug pages that uses this utility was used. Release note (bug fix): Fixed a bug causing tracing to external tracers to inadvertently stop after the Enqueue Range or the Allocator debug pages was used. Co-authored-by: Andrei Matei <[email protected]> Co-authored-by: Rafi Shamim <[email protected]> Co-authored-by: Nathan Stilwell <[email protected]>
- Loading branch information