planner, util: fix statement summary history and display correctness - #70159
planner, util: fix statement summary history and display correctness#70159jiong-nba wants to merge 7 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
jiong seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (14)
🚧 Files skipped from review as they are similar to previous changes (11)
📝 WalkthroughWalkthroughThe changes correct statement-summary time-bound extraction, history retention order, execution-based averages, table-name joining, and v2 digest text formatting. Regression tests cover planner predicates, history resizing, metric calculations, table names, and SQL formatting. ChangesStatement summary correctness
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #70159 +/- ##
================================================
- Coverage 76.3254% 73.8341% -2.4913%
================================================
Files 2041 2060 +19
Lines 559516 579756 +20240
================================================
+ Hits 427053 428058 +1005
- Misses 131563 151325 +19762
+ Partials 900 373 -527
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
96eaf4c to
2d6d889
Compare
|
[FORMAT CHECKER NOTIFICATION] Notice: To remove the 📖 For more info, you can check the "Contribute Code" section in the development guide. |
|
@jiong-nba: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What problem does this PR solve?
Issue Number: #70161
Problem Summary:
Statement Summary v1/v2 has several independent read and display correctness issues: open-ended history predicates are narrowed to one hour, history readers return stale intervals, execution averages use the commit count, table names can contain trailing separators, and v2
DIGEST_TEXTignorestidb_stmt_summary_max_sql_length.What changed and how does it work?
MinDatetime/MaxDatetime.EXEC_COUNTas the denominator for execution-based KV/PD/backoff/write-response averages in v1 and v2.TABLE_NAMESin v1 and v2.DIGEST_TEXTwith the same configured SQL-length behavior as v1.Each fix is kept in its own commit to make review and selective backporting straightforward.
Check List
Tests
./tools/check/failpoint-go-test.sh pkg/util/stmtsummary -run '^(TestHistoryClearAndResizeKeepsLatestIntervals|TestEvictedHistoryCollectionKeepsLatestIntervals|TestExecutionAverageColumnsUseExecCount|TestTableNamesSkipEmptyTables)$' -tags=intest,deadlock -count=1go test ./pkg/util/stmtsummary/v2 -run '^(TestExecutionAverageColumnsUseExecCount|TestStmtRecordTableNamesSkipEmptyTables|TestStmtRecordFormatsDigestText)$' -tags=intest,deadlock -count=1-race.go test ./pkg/planner/core/operator/logicalop/logicalop_test -run '^TestStatementsSummaryExtractorOpenEndedTimeRange$' -tags=intest,deadlock -count=1make lintmake bazel_prepareis blocked locally becausebazelis not installed.Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
Summary by CodeRabbit
Summary by CodeRabbit