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

statistics: handle the prune mode correctly in the refresher #57096

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

Rustin170506
Copy link
Member

@Rustin170506 Rustin170506 commented Nov 4, 2024

What problem does this PR solve?

Issue Number: close #57168

Problem Summary:

What changed and how does it work?

When checking the prune mode, we need to ensure that we have loaded the latest variable value. However, directly using the system session pool does not work, as it requires manual updates to obtain the latest global variable value.

In this PR, I utilized the session context from the caller that has already updated the session, allowing us to correctly retrieve the prune mode.

For earlier versions of TiDB, this issue did not occur because we did not use this session to retrieve the global variable in those versions.

Additionally, I added a test case for the queue to verify the handling of DML changes for partitioned tables.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 4, 2024
Copy link

codecov bot commented Nov 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 57.2470%. Comparing base (538839b) to head (e0ab534).
Report is 20 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #57096         +/-   ##
=================================================
- Coverage   73.2121%   57.2470%   -15.9651%     
=================================================
  Files          1652       1809        +157     
  Lines        456143     653936     +197793     
=================================================
+ Hits         333952     374359      +40407     
- Misses       101669     254719     +153050     
- Partials      20522      24858       +4336     
Flag Coverage Δ
integration 39.0066% <0.0000%> (?)
unit 72.9999% <100.0000%> (+0.5109%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.9478% <ø> (ø)
parser ∅ <ø> (∅)
br 52.4788% <ø> (+6.4909%) ⬆️

@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 4, 2024
@Rustin170506 Rustin170506 changed the title statistics: add more test cases for the queue statistics: handle the prune mode correctly in the refresher Nov 4, 2024
@wuhuizuo
Copy link
Contributor

wuhuizuo commented Nov 4, 2024

/retest

Copy link
Member Author

@Rustin170506 Rustin170506 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔢 Self-check (PR reviewed by myself and ready for feedback.)

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 5, 2024
Copy link

ti-chi-bot bot commented Nov 5, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AilinKid, qw4990

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 5, 2024
Copy link

ti-chi-bot bot commented Nov 5, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-11-05 09:27:07.08151802 +0000 UTC m=+946739.920673563: ☑️ agreed by qw4990.
  • 2024-11-05 10:17:03.869450214 +0000 UTC m=+949736.708605762: ☑️ agreed by AilinKid.

@ti-chi-bot ti-chi-bot bot merged commit b71f0c0 into pingcap:master Nov 5, 2024
24 checks passed
@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Nov 6, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #57169.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The PQ cannot handle the prune mode change correctly
5 participants