Skip to content
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

SQL Activity: Reset stats does not clear new system.{statement/transaction}_activity tables #104321

Closed
j82w opened this issue Jun 5, 2023 · 0 comments · Fixed by #104337
Closed
Assignees
Labels
A-cluster-observability Related to cluster observability C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Comments

@j82w
Copy link
Contributor

j82w commented Jun 5, 2023

Resetting the SQL statistics does not reset the new system.statement_activity and system.transaction_activity tables.

Jira issue: CRDB-28465

@j82w j82w added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-cluster-observability A-cluster-observability Related to cluster observability labels Jun 5, 2023
@j82w j82w self-assigned this Jun 5, 2023
craig bot pushed a commit that referenced this issue Jun 5, 2023
104290: sql: make transaction_rows_read_err prevent large scans r=rytaft a=rytaft

Prior to this commit, setting `transaction_rows_read_err` to a non-zero value would cause a transaction to fail as soon as a statement caused the total number of rows read to exceed `transaction_rows_read_err`. However, it was possible that each statement could read many more than `transaction_rows_read_err` rows. This commit adds logic so that a single scan never reads more than `transaction_rows_read_err+1` rows if `transaction_rows_read_err` is set.

Informs #70473

Release note (performance improvement): If `transaction_rows_read_err` is set to a non-zero value, we now ensure that any single scan never reads more than `transaction_rows_read_err+1` rows. This prevents transactions that would error due to the `transaction_rows_read_err` setting from causing a large performance overhead due to large scans.

104337: sql: fix reset_sql_stats to truncate activity tables r=j82w a=j82w

Previously:
The reset stats on the ui and crdb_internal.reset_sql_stats() would only reset the statement_statistics and transaction_statics tables. This would leave the sql_activity table with old data. The reset stats now truncates the sql_activity table as well.

Fixes: #104321
Epic: none

Release note (sql change): Fix crdb_internal.reset_sql_stats() to
 cleanup the sql_activity table which work as a cache for the stats.

Co-authored-by: Rebecca Taft <[email protected]>
Co-authored-by: j82w <[email protected]>
@craig craig bot closed this as completed in 1d51268 Jun 5, 2023
blathers-crl bot pushed a commit that referenced this issue Jun 5, 2023
Previously:
The reset stats on the ui and crdb_internal.reset_sql_stats() would
only reset the statement_statistics and transaction_statics tables.
This would leave the sql_activity table with old data. The reset stats
now truncates the sql_activity table as well.

Fixes: #104321
Epic: none

Release note (sql change): Fix crdb_internal.reset_sql_stats() to
 cleanup the sql_activity table which work as a cache for the stats.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cluster-observability Related to cluster observability C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant