-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
67386: tracing, server, jobs: add TraceDumper to dump trace zips on job failure r=adityamaru a=adityamaru tracing: move trace zipping logic to a utility struct This change introduces a "zipper" to the tracing package. The zipper can be backed by either a network based SQLConn or an internal executor. Based on the nature of the SQL connection the zipper contacts the indexed virtual table `cluster_inflight_traces` and generates a trace zip. The zip contains per node traces of inflight trace spans with a given trace id. The logic of creating the trace files has not changed, but has been moved from `pkg/cli/debug_job_trace.go` to the dedicated tracing/zipper package. Both versions of the zipper will be tested by the components that use them. - SQLConn via `cockroach debug job-trace` - InternalExecutor via `TraceDumper` (in the next commit) Release note: None server,jobs: add a TraceDumper to dump inflight trace zips This change does two things: 1. It adds a TraceDumper that can be used to dump a trace zip for a particular trace id. The dumper uses the tracing.zipper to generate a zip of all inflight traces in the cluster. The zip is appropriately named (including a created at timestamp for the purpose of GC) and is stored in a subdirectory of the log directory. 2. Introduces a cluster setting `jobs.trace.force_dump_mode` that allows users to configure Traceable jobs to dump their traces on failure, on all status changes or never.o Note: as of this PR only backup and import are "traceable" jobs. Release note (sql change): Introduces a new cluster setting `jobs.trace.force_dump_mode` that allows users to configure Traceable jobs to dump their traces: `never`: Job will never dump its traces. `onFail`: Job will dump its trace after transitioning to the `failed` state. `onStatusChange`: Job will dump its trace whenever it transitions from paused, canceled, succeeded or failed state. Co-authored-by: Aditya Maru <[email protected]>
- Loading branch information
Showing
33 changed files
with
1,197 additions
and
274 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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
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
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
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
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
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
Oops, something went wrong.