-
Notifications
You must be signed in to change notification settings - Fork 4k
sql: add transaction diagnostic bundle tables #152861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kyle-a-wong reviewed 10 of 10 files at r1.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @dhartunian)
pkg/upgrade/upgrades/v25_4_transaction_diagnostics_tables.go
line 21 at r1 (raw file):
addTransactionDiagnosticsIDColumn = ` ALTER TABLE system.statement_diagnostics ADD COLUMN IF NOT EXISTS transaction_diagnostics_id INT8
I think you need to add this to the primary family too
Suggestion:
ADD COLUMN IF NOT EXISTS transaction_diagnostics_id INT8 FAMILY primary
pkg/sql/catalog/systemschema/system.go
line 563 at r1 (raw file):
completed BOOL NOT NULL DEFAULT FALSE, transaction_fingerprint_id STRING NOT NULL, statement_fingerprints STRING[] NOT NULL,
Do you think these should have the BYTES
type, to match the fingerprint_id column types in system.statement_statistics
?
Code quote:
transaction_fingerprint_id STRING NOT NULL,
statement_fingerprints STRING[] NOT NULL,
pkg/sql/catalog/systemschema/system.go
line 563 at r1 (raw file):
completed BOOL NOT NULL DEFAULT FALSE, transaction_fingerprint_id STRING NOT NULL, statement_fingerprints STRING[] NOT NULL,
I think statement_fingerprints
should be statement_fingerprint_ids
, and it should store the IDs, not the fingerprints themselves. What do you think?
pkg/sql/catalog/systemschema/system.go
line 579 at r1 (raw file):
id INT8 DEFAULT unique_rowid() NOT NULL, transaction_fingerprint_id STRING NOT NULL, statement_fingerprints STRING[] NOT NULL,
same comments here
Code quote:
transaction_fingerprint_id STRING NOT NULL,
statement_fingerprints STRING[] NOT NULL,
9df4106
to
403cd12
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @jeffswenson, @kyle-a-wong, and @mw5h)
pkg/sql/catalog/systemschema/system.go
line 563 at r1 (raw file):
Previously, kyle-a-wong (Kyle Wong) wrote…
Do you think these should have the
BYTES
type, to match the fingerprint_id column types insystem.statement_statistics
?
done.
pkg/sql/catalog/systemschema/system.go
line 563 at r1 (raw file):
Previously, kyle-a-wong (Kyle Wong) wrote…
I think
statement_fingerprints
should bestatement_fingerprint_ids
, and it should store the IDs, not the fingerprints themselves. What do you think?
done.
pkg/sql/catalog/systemschema/system.go
line 579 at r1 (raw file):
Previously, kyle-a-wong (Kyle Wong) wrote…
same comments here
done.
pkg/upgrade/upgrades/v25_4_transaction_diagnostics_tables.go
line 21 at r1 (raw file):
Previously, kyle-a-wong (Kyle Wong) wrote…
I think you need to add this to the primary family too
done.
403cd12
to
7c7b6d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kyle-a-wong reviewed 1 of 17 files at r3.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @jeffswenson and @mw5h)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @jeffswenson and @mw5h)
pkg/sql/catalog/systemschema/system.go
line 568 at r3 (raw file):
expires_at TIMESTAMPTZ NULL, sampling_probability FLOAT NULL, redact BOOL NOT NULL DEFAULT FALSE,
Oops, I just noticed that this table doesnt include a "username" column for the user who initializes the request. Can you add this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @dhartunian, @jeffswenson, and @mw5h)
pkg/sql/catalog/systemschema/system.go
line 568 at r3 (raw file):
Previously, kyle-a-wong (Kyle Wong) wrote…
Oops, I just noticed that this table doesnt include a "username" column for the user who initializes the request. Can you add this?
I think we will also need a transaction_diagnostics_id
column in this table so that we can make a download link in db-console
7c7b6d5
to
232ece7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status:
complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @jeffswenson, @kyle-a-wong, and @mw5h)
pkg/sql/catalog/systemschema/system.go
line 568 at r3 (raw file):
Previously, kyle-a-wong (Kyle Wong) wrote…
I think we will also need a
transaction_diagnostics_id
column in this table so that we can make a download link in db-console
done on both. also changed to bundle_chunks
.
232ece7
to
daa07a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mw5h reviewed 4 of 10 files at r1, 9 of 30 files at r2, 1 of 4 files at r4.
Reviewable status:complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @jeffswenson and @kyle-a-wong)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status:
complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @jeffswenson and @kyle-a-wong)
242ce9e
to
c3c202f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kyle-a-wong reviewed 1 of 46 files at r6.
Reviewable status:complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @jeffswenson)
c3c202f
to
a7873f7
Compare
Your pull request contains more than 1000 changes. It is strongly encouraged to split big PRs into smaller chunks. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
7f45a29
to
3d3f614
Compare
@kyle-a-wong can you take one more look. Here's what I changed:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yuzefovich reviewed 3 of 10 files at r1, 24 of 30 files at r2, 16 of 17 files at r3, 41 of 46 files at r6, 5 of 5 files at r7, 8 of 8 files at r8, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (and 2 stale) (waiting on @jeffswenson and @kyle-a-wong)
pkg/sql/catalog/systemschema/system.go
line 545 at r8 (raw file):
StatementDiagnosticsTableSchema = ` create table system.statement_diagnostics( id INT8 DEFAULT unique_rowid() NOT NULL,
nit: since we're here anyway, it'd be nice to fix the indentation.
67e537f
to
9964fac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status:
complete! 0 of 0 LGTMs obtained (and 3 stale) (waiting on @jeffswenson, @kyle-a-wong, and @yuzefovich)
pkg/sql/catalog/systemschema/system.go
line 545 at r8 (raw file):
Previously, yuzefovich (Yahor Yuzefovich) wrote…
nit: since we're here anyway, it'd be nice to fix the indentation.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status:
complete! 0 of 0 LGTMs obtained (and 3 stale) (waiting on @jeffswenson and @yuzefovich)
pkg/upgrade/upgrades/v25_4_transaction_diagnostics_tables_test.go
line 86 at r10 (raw file):
) } // Validate that the eventlog table has the old
nit: statement diagnostics
Suggestion:
statement diagnostics
9964fac
to
188e2d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status:
complete! 0 of 0 LGTMs obtained (and 3 stale) (waiting on @jeffswenson, @kyle-a-wong, and @yuzefovich)
pkg/upgrade/upgrades/v25_4_transaction_diagnostics_tables_test.go
line 86 at r10 (raw file):
Previously, kyle-a-wong (Kyle Wong) wrote…
nit: statement diagnostics
done
TFTRs everyone! bors r=kyle-a-wong,yuzefovich,mw5h |
bors r- |
This commit contains a schema change and an upgrade migration to begin adding support for transaction diagnostic bundles. The new functionality will maintain diagnostic bundle requests and record completed diagnostics very similar to statement diagnostics. We have a `transaction_diagnostic_requests` table which holds pending requests and marks them as completed. Future PRs will poll this table to update the in-memory registry of pending requests to match against incoming SQL. We also have a `transaction_diagnostics` table which holds rows for completed diagnostics requests. Notable details: - Transaction diagnostic bundle requests store fingerprint IDs for transactions and statements which can be resolved to fingerprints via the SQL Activity tables. - Completed transaction diagnostics reference chunks that contain the trace (and any other metadata) for the entire transaction. - Statement diagnostic bundles will now potentially point to a "parent" transaction diagnostic bundle Also fixed up some whitespace in the diagnostic bundle system schema. Resolves: CRDB-53545 Epic: CRDB-53541 Release note: None
188e2d6
to
ce8e441
Compare
bors r+ |
Build succeeded: |
This commit contains a schema change and an upgrade migration to begin adding support for transaction diagnostic bundles.
The new functionality will maintain diagnostic bundle requests and record completed diagnostics very similar to statement diagnostics. We have a
transaction_diagnostic_requests
table which holds pending requests and marks them as completed. Future PRs will poll this table to update the in-memory registry of pending requests to match against incoming SQL. We also have atransaction_diagnostics
table which holds rows for completed diagnostics requests.Notable details:
Resolves: CRDB-53545
Epic: CRDB-53541
Release note: None