Skip to content

Conversation

YangKeao
Copy link
Member

@YangKeao YangKeao commented Feb 13, 2025

What problem does this PR solve?

Issue Number: close #59476

Problem Summary:

We need a mechanism to detect whether two TiDB servers are in the same tidb cluster. Adding the cluster_id to the mysql.tidb table is the most sutiable way. I've also considered other options in #59476 .

What changed and how does it work?

Add the cluster_id row to the mysql.tidb 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.

Insert the `cluster_id` to the `mysql.tidb` table.

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Feb 13, 2025
@YangKeao
Copy link
Member Author

/cc @benmeadowcroft

Copy link

ti-chi-bot bot commented Feb 13, 2025

@YangKeao: GitHub didn't allow me to request PR reviews from the following users: BenMeadowcroft.

Note that only pingcap members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @benmeadowcroft

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.

Copy link

codecov bot commented Feb 13, 2025

Codecov Report

Attention: Patch coverage is 85.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 74.8387%. Comparing base (397b0f2) to head (43a9ed8).
Report is 14 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #59511        +/-   ##
================================================
+ Coverage   73.0599%   74.8387%   +1.7788%     
================================================
  Files          1690       1740        +50     
  Lines        467367     479651     +12284     
================================================
+ Hits         341458     358965     +17507     
+ Misses       104902      98239      -6663     
- Partials      21007      22447      +1440     
Flag Coverage Δ
integration 48.9721% <75.0000%> (?)
unit 72.3793% <85.0000%> (+0.1426%) ⬆️

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

Components Coverage Δ
dumpling 52.6910% <ø> (ø)
parser ∅ <ø> (∅)
br 59.3700% <ø> (+13.5841%) ⬆️

Copy link
Contributor

@Defined2014 Defined2014 left a comment

Choose a reason for hiding this comment

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

Please fix the UT

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Feb 13, 2025
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Feb 13, 2025
Copy link

ti-chi-bot bot commented Feb 13, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-02-13 07:06:56.339948129 +0000 UTC m=+513058.736170186: ☑️ agreed by Defined2014.
  • 2025-02-13 07:08:55.598991631 +0000 UTC m=+513177.995213692: ☑️ agreed by lance6716.

Copy link

ti-chi-bot bot commented Feb 13, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Defined2014, lance6716, Leavrth, yudongusa

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 the approved label Feb 13, 2025
@ti-chi-bot ti-chi-bot bot merged commit f6bf8e8 into pingcap:master Feb 13, 2025
27 checks passed
zeminzhou pushed a commit to zeminzhou/tidb that referenced this pull request May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

Add cluster_id to the mysql.tidb
6 participants