Skip to content

Conversation

djshow832
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #60401

Problem Summary:
Previously, the etcdCli used for DDL owner was created by the domain with a keyspace prefix, so that each keyspace has a separate DDL owner.
However, in #57179, the global DDL owner creates etcdCli by itself without the keyspace prefix, so all the keyspaces share the same DDL owner. When bootstrapping, the DDL owner is occupied by another TiDB, and this TiDB keeps in the loop of the bootstrap.

What changed and how does it work?

Set the etcdCli prefix before creating the DDL owner.

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.
  1. Start a tidb without a keyspace
  2. Register PD with a keyspace test
  3. Start a tidb with keyspace test

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. do-not-merge/needs-triage-completed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 7, 2025
Copy link

tiprow bot commented Apr 7, 2025

Hi @djshow832. 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-sigs/prow repository.

@djshow832
Copy link
Contributor Author

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Apr 7, 2025
Copy link

ti-chi-bot bot commented Apr 7, 2025

@ystaticy: adding LGTM is restricted to approvers and reviewers in OWNERS files.

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

Copy link

codecov bot commented Apr 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.6218%. Comparing base (84c3948) to head (857ce5c).
Report is 35 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #60403        +/-   ##
================================================
+ Coverage   73.1167%   75.6218%   +2.5051%     
================================================
  Files          1711       1760        +49     
  Lines        473138     492121     +18983     
================================================
+ Hits         345943     372151     +26208     
+ Misses       105937      97450      -8487     
- Partials      21258      22520      +1262     
Flag Coverage Δ
integration 49.5132% <0.0000%> (?)
unit 73.1790% <100.0000%> (+0.8571%) ⬆️

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

Components Coverage Δ
dumpling 52.6553% <ø> (ø)
parser ∅ <ø> (∅)
br 62.6350% <ø> (+15.4065%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lance6716
Copy link
Contributor

/cc @D3Hunter

@ti-chi-bot ti-chi-bot bot requested a review from D3Hunter April 7, 2025 03:35
@@ -68,6 +71,10 @@ func (om *ownerManager) Start(ctx context.Context, store kv.Storage) error {
if cli == nil {
return errors.New("etcd client is nil, maybe the server is not started with PD")
}
// nil in unit tests
if store != nil && !reflect.ValueOf(store).IsNil() {
Copy link
Contributor

Choose a reason for hiding this comment

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

if store is nil, cli will be nil, code won't reach here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, cli is not nil. TestOwnerManager fails because of it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is not reasonable to pass nil kv.Storage. How about fixing TestOwnerManager by passing a real store?

@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 9, 2025
@djshow832
Copy link
Contributor Author

/retest

@djshow832
Copy link
Contributor Author

/retest

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 10, 2025
Copy link

ti-chi-bot bot commented Apr 10, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: D3Hunter, tangenta, ystaticy

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 Apr 10, 2025
Copy link

ti-chi-bot bot commented Apr 10, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-04-10 02:50:59.426970544 +0000 UTC m=+2311153.111206684: ☑️ agreed by tangenta.
  • 2025-04-10 03:33:25.449241288 +0000 UTC m=+2313699.133477384: ☑️ agreed by D3Hunter.

@hawkingrei
Copy link
Member

/retest

8 similar comments
@djshow832
Copy link
Contributor Author

/retest

@djshow832
Copy link
Contributor Author

/retest

@djshow832
Copy link
Contributor Author

/retest

@djshow832
Copy link
Contributor Author

/retest

@djshow832
Copy link
Contributor Author

/retest

@djshow832
Copy link
Contributor Author

/retest

@djshow832
Copy link
Contributor Author

/retest

@djshow832
Copy link
Contributor Author

/retest

@ti-chi-bot ti-chi-bot bot merged commit 22a8df5 into pingcap:master Apr 10, 2025
27 checks passed
@djshow832 djshow832 deleted the fix_etcd branch April 10, 2025 23:58
@bb7133 bb7133 added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Apr 11, 2025
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Apr 11, 2025
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #60501.
But this PR has conflicts, please resolve them!

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. ok-to-test Indicates a PR is ready to be tested. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DDL owner doesn't have a keyspace prefix
8 participants