-
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.
76886: sql: scheduled logger to capture index usage stats r=THardy98 a=THardy98 Resolves: #72486 This change introduces a scheduled logger that captures index usage statistics logs on a time interval. Release note (sql change): Initial implementation of a scheduled logger used to capture index usage statistics to the telemetry logging channel. Release justification: Category 4: Low risk, high benefit changes to existing functionality. 76917: sql: introduce crdb_internal.transaction_contention_events virtual table r=maryliag,matthewtodd a=Azhng This commit introduces `crdb_internal.transaction_contention_events` virtual table. This virtual tables exposes transaction contention events annotated with transaction fingerprint IDs for transactions that have finished executing. This allows this virtual table to be joined into the statement statistics and transaction statistics tables. The new virtual table require either VIEWACTIVITYREDACTED OR VIEWACTIVITY role option to access. However, if user has VIEWACTIVTYREDACTED role, the contending key will be redacted. The contention events are stored in memory. The amount of contention events stored is controlled via 'sql.contention.event_store.capacity' cluster setting. The new table has the following schema: CREATE TABLE crdb_internal.transaction_contention_events ( collection_ts TIMESTAMPTZ NOT NULL, blocking_txn_id UUID NOT NULL, blocking_txn_fingerprint_id BYTES NOT NULL, waiting_txn_id UUID NOT NULL, waiting_txn_fingerprint_id BYTES NOT NULL, contention_duration INTERVAL NOT NULL, contending_key BYTES NOT NULL ) * collected_ts: stores the timestamp of when the contention event was collected * blocking_txn_id: stores the transaction ID of the blocking transaction of the contention event. This column can be joined into `crdb_internal.cluster_contention_events` or `crdb_internal.node_contention_events` table. * blocking_txn_fingerprint_id: stores the transaction fingerprint ID of the blocking transaction fingerprint IDs. This can be used to join into the `crdb_internal.statement_statistics` and `crdb_internal.transaction_statistics` tables to surface historical information of the transactions that caused the contention. * waiting_txn_id: stores the transaction ID of the waiting transaction in the contention event. Similar to `blocking_txn_id`, this column can be joined into `crdb_internal.cluster_contention_events` and `crdb_internal.node_contention_events` tables. * waiting_txn_fingerprint_id: stores the transaction fingerprint ID of the waiting transaction. Similar to `blocking_txn_fingerprint_id`, this column can be joined to `crdb_internal.statement_statistics` and `crdb_internal.transaction_statistics` tables. * contention_duration: stores the amount of time the waiting transaction spent waiting for the blocking transaction. * contending_key: stores the key that caused the contention. If the user has VIEWACTIVITYREDACTED role option, this column is redacted. Resolves #75904 Release note (sql change): introducing `crdb_internal.transaction_contention_events` virtual table, that exposes historical transaction contention events. The events exposed in the new virtual table also include transaction fingerprint IDs for both blocking and waiting transactions. This allows the new virtual table to be joined into statement statistics and transaction statistics tables. The new virtual table require either VIEWACTIVITYREDACTED OR VIEWACTIVITY role option to access. However, if user has VIEWACTIVTYREDACTED role, the contending key will be redacted. The contention events are stored in memory. The amount of contention events stored is controlled via 'sql.contention.event_store.capacity' cluster setting. Release note (api change): introducing GET `/_status/transactioncontentionevents` endpoint, that returns cluster-wide in-memory historical transaction contention events. The endpoint require either VIEWACTIVITYREDACTED OR VIEWACTIVITY role option to access. However, if user has VIEWACTIVTYREDACTED role, the contending key will be redacted. The contention events are stored in memory. The amount of contention events stored is controlled via 'sql.contention.event_store.capacity' cluster setting. Release Justification: Low risk, high benefit change Co-authored-by: Thomas Hardy <[email protected]> Co-authored-by: Azhng <[email protected]>
- Loading branch information
Showing
45 changed files
with
3,281 additions
and
1,666 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
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
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.