util: fix incorrect statement summary Others rows#69914
Conversation
📝 WalkthroughWalkthroughAdds a non-mutating ChangesStatement summary cache correctness
Estimated code review effort: 3 (Moderate) | ~25 minutes Suggested labels: 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 |
6d706d0 to
997c0e3
Compare
|
[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 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #69914 +/- ##
================================================
- Coverage 76.3193% 75.5450% -0.7743%
================================================
Files 2041 2086 +45
Lines 559929 583081 +23152
================================================
+ Hits 427334 440489 +13155
- Misses 131694 140445 +8751
- Partials 901 2147 +1246
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
The persistent v2 implementation appears to have the same ordering issue in Was v2 intentionally left out of this PR? If so, could we create and link a follow-up issue? Otherwise, could we use the new non-mutating lookup here as well and add an equivalent v2 regression? |
|
Could we also cover clearing an actual internal entry? All entries in the new regression currently have I reproduced this at the PR head: after enabling internal summaries, adding an |
|
@XuHuaiyu Addressed both review points in
The regressions failed before the fixes exactly as expected: v1 retained |
|
/retest unit-test |
|
@nolouch: The The following commands are available to trigger optional jobs: Use DetailsIn response to this:
Instructions 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. |
|
/test unit-test |
What problem does this PR solve?
Issue Number: close #69913
Problem Summary:
The v1 current statement-summary reader can expose the latest
Othersroweven when it belongs to a previous interval. Separately, reapplying
tidb_stmt_summary_internal_query=OFFscans the LRU withGet, which reversesthe LRU order and causes hot statements to be evicted into
Others.What changed and how does it work?
Othersrow with the same current-interval boundary usedfor regular statement-summary rows.
SimpleLRUCache.Peekoperation and use it in both v1 andpersistent v2 while removing internal statement summaries, preserving the
LRU order.
existing AND semantics so mixed internal/external digests survive cleanup.
Othersrow, a capacity-20 LRUwith two hot statements, actual internal-row cleanup, mixed digest retention,
and the equivalent persistent-v2 eviction behavior.
LoadSysVarCacheLoopreapplies the unchanged
OFFvalue through the statement-summary callback.TestIssue68550, which was added onmasterwithout its generated shardupdate.
Check List
Tests
Commands:
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests