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

domain, statistics: periodically update stats healthy distribution (#39739) #50985

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #39739

What problem does this PR solve?

Issue Number: close #39349

Problem Summary:

What is changed and how it works?

Update stats healthy distribution metrics periodically, which is easy to implement and can avoid corner cases like #39349.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)

tiup playground nightly --db 2 --db.binpath /Users/xuyifan/tidb/bin/tidb-server --kv 3 --tiflash 0

create table t1(a int, b int);
drop table t1;
CREATE TABLE t2 (a int, b int) PARTITION BY RANGE ( a ) (
    PARTITION p0 VALUES LESS THAN (10),
    PARTITION p1 VALUES LESS THAN (20),
    PARTITION p2 VALUES LESS THAN (30),
    PARTITION p3 VALUES LESS THAN (MAXVALUE));
alter table t2 drop partition p3;
drop table t2;

Screen Shot 2022-12-14 at 1 49 21 PM

PS: I found that after dropping table t2, stats of t2 global are removed from cache very soon while stats of p0, p1, p2 still exist in cache until GCStats is triggered. However, if we don't execute alter table t2 drop partition p3 and directly drop table t2, partition stats are removed from cache very soon. It is a minor problem and the pr doesn't handle it.

  • No code

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 added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-6.5 This PR is cherry-picked to release-6.5 from a source PR. labels Feb 5, 2024
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Feb 5, 2024
Copy link
Member

@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.

Looks good to me. Thanks! 👍

@ti-chi-bot ti-chi-bot bot added the lgtm label Feb 5, 2024
Copy link

ti-chi-bot bot commented Feb 5, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hi-rustin, winoros

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 removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Feb 5, 2024
Copy link

ti-chi-bot bot commented Feb 5, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-02-05 09:54:36.24109857 +0000 UTC m=+177801.807868445: ☑️ agreed by winoros.
  • 2024-02-05 09:55:24.170673131 +0000 UTC m=+177849.737443020: ☑️ agreed by hi-rustin.

@ti-chi-bot ti-chi-bot added the cherry-pick-approved Cherry pick PR approved by release team. label Feb 5, 2024
@ti-chi-bot ti-chi-bot bot merged commit 2ec7e32 into pingcap:release-6.5 Feb 5, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved cherry-pick-approved Cherry pick PR approved by release team. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-6.5 This PR is cherry-picked to release-6.5 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants