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 |
📝 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
Possibly related PRs
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.8568% -2.4686%
================================================
Files 2041 2060 +19
Lines 559516 582137 +22621
================================================
+ Hits 427053 429948 +2895
- Misses 131563 151683 +20120
+ Partials 900 506 -394
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
2d6d889 to
61e4085
Compare
|
@jiong-nba: The following tests 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: ref #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
Bug Fixes
Tests