-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#23788] YSQL, QueryDiagnostics: Fixing issues in pg_stat_statements …
…when no query executed Summary: - Fixes issue where pgss_copy.query_len being 0 leads to test failures, especially in ASAN builds, when a diagnostics bundle is triggered but no query is executed. - Adds logic to handle cases where pg_stat_statements_reset() is called during the bundle's duration, dumping only counters data with an empty query string. - Resolves problem of losing the last character in the pg_stat_statements.csv file. - Modifies the behavior of GetAshRangeIndexes() to append the description "No data available in ASH for the given time range" instead of overwriting the existing catalog description. - Removes unnecessary AddinShmemInitLock lock to improve efficiency in this scenario. - Even in the case :- ``` bundle started. query executed pgss reset query executed bundle ended ``` `pg_stat_statements was reset, query string not available;` warning is displayed through yb_query_diagnostics_status. This is intentional as if we were to implement a check for last_time_query_bundled against last_time_reset, it would require a `GetCurrentTimestamp()` call per bundled query, which could be expensive. Jira: DB-12692 Test Plan: ./yb_build.sh --java-test TestYbQueryDiagnostics#checkAshData ./yb_build.sh --java-test TestYbQueryDiagnostics#checkPgssData Reviewers: asaha, telgersma Reviewed By: asaha, telgersma Subscribers: yql Differential Revision: https://phorge.dev.yugabyte.com/D37895
- Loading branch information
1 parent
35b12d2
commit 008f885
Showing
5 changed files
with
258 additions
and
71 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
Oops, something went wrong.