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

infoschema: fix regression on select table_rows from information_schema.tables for partition table #51980

Merged
merged 3 commits into from Mar 21, 2024

Conversation

ywqzzy
Copy link
Contributor

@ywqzzy ywqzzy commented Mar 21, 2024

What problem does this PR solve?

Issue Number: close #51942

Problem Summary:
In #50874 we update the updating logic of stat cache.
We only update stat cache in 2 scenes:

  1. per 3 seconds when running selection on information_schema.tables
  2. when accessing the actual table when running selection on information_schema.tables, update cache by table id.

But the updating logic 2 didn't table partitions for partition table into consideration.
We should update each partitions when getting the table_rows for partition table.

What changed and how does it work?

Update stat cache for all partitions of partition table

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 do-not-merge/needs-triage-completed release-note-none do-not-merge/needs-tests-checked size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 21, 2024
Copy link

tiprow bot commented Mar 21, 2024

Hi @ywqzzy. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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/test-infra repository.

@ywqzzy ywqzzy changed the title infoschema: fix reg on select rowCount from tables for partition table infoschema: fix regression on select rowCount from tables for partition table Mar 21, 2024
@ywqzzy ywqzzy changed the title infoschema: fix regression on select rowCount from tables for partition table infoschema: fix regression on select table_rows from information_schema.tables for partition table Mar 21, 2024
Copy link

codecov bot commented Mar 21, 2024

Codecov Report

Merging #51980 (1ca60d5) into master (e03da4d) will decrease coverage by 17.4694%.
Report is 7 commits behind head on master.
The diff coverage is 50.0000%.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #51980         +/-   ##
=================================================
- Coverage   72.4625%   54.9931%   -17.4694%     
=================================================
  Files          1478       1592        +114     
  Lines        365027     612905     +247878     
=================================================
+ Hits         264508     337056      +72548     
- Misses        81022     252569     +171547     
- Partials      19497      23280       +3783     
Flag Coverage Δ
integration 36.8582% <50.0000%> (?)
unit 70.7067% <50.0000%> (-1.6447%) ⬇️

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

Components Coverage Δ
dumpling 53.9957% <ø> (-2.3014%) ⬇️
parser ∅ <ø> (∅)
br 51.5305% <ø> (+5.1588%) ⬆️

Copy link

ti-chi-bot bot commented Mar 21, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-03-21 07:34:05.1754742 +0000 UTC m=+1534872.197720584: ☑️ agreed by hawkingrei.
  • 2024-03-21 07:41:04.331677915 +0000 UTC m=+1535291.353924302: ☑️ agreed by lance6716.

@lance6716
Copy link
Contributor

/hold

new comments arrived

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 21, 2024
Co-authored-by: tangenta <tangenta@126.com>
Copy link

ti-chi-bot bot commented Mar 21, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hawkingrei, lance6716, tangenta

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:
  • OWNERS [hawkingrei,lance6716,tangenta]

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

@tangenta
Copy link
Contributor

/unhold

1 similar comment
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Mar 21, 2024

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 21, 2024
@ti-chi-bot ti-chi-bot bot merged commit 454e5a7 into pingcap:master Mar 21, 2024
21 checks passed
@ti-chi-bot
Copy link
Member

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

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.0 release-note-none size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tables info not updated for a long time
5 participants