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

ddl: mitigate the issue that multiple owner might exist during force to be owner #56963

Merged
merged 9 commits into from
Oct 31, 2024

Conversation

D3Hunter
Copy link
Contributor

@D3Hunter D3Hunter commented Oct 29, 2024

What problem does this PR solve?

Issue Number: close #56924, #56713

Problem Summary:

What changed and how does it work?

force owner, see #57185
older versions which don't have the fix of #54689, when upgrade and forcing newer version node to be owner, multiple owner might exist at the same time, this pr tries to mitigate the issue, see code comments for more detail

also mitigate #57003 by sleep after force to be owner

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
    • start a v7.5.0 cluster with 3 TiDBs, rolling upgrade to this pr, success
    • start a v8.1.1 cluster with 3 TiDBs, rolling upgrade to this pr, success
    • start a v7.5.0 cluster with 3 TiDBs, stop all TiDBs, then start them with this pr, success
      • Note: after this PR, we will aquire distributed lock before start domain, so in this case, the 2 non-owner node will not involve in schema version sync for upgrade DDL
  • 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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 29, 2024
Copy link

codecov bot commented Oct 29, 2024

Codecov Report

Attention: Patch coverage is 41.02564% with 115 lines in your changes missing coverage. Please review.

Project coverage is 57.4608%. Comparing base (7292117) to head (1c641c8).
Report is 48 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #56963         +/-   ##
=================================================
- Coverage   73.2789%   57.4608%   -15.8182%     
=================================================
  Files          1636       1804        +168     
  Lines        453658     648330     +194672     
=================================================
+ Hits         332436     372536      +40100     
- Misses       100846     250408     +149562     
- Partials      20376      25386       +5010     
Flag Coverage Δ
integration 39.5138% <25.1282%> (?)
unit 72.6226% <36.9230%> (+0.1347%) ⬆️

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

Components Coverage Δ
dumpling 52.9478% <ø> (ø)
parser ∅ <ø> (∅)
br 63.0994% <100.0000%> (+17.1195%) ⬆️

@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 30, 2024
@D3Hunter
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Oct 30, 2024

@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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.

@D3Hunter D3Hunter changed the title [WIP]ddl: mitigate the issue that multiple owner might exist during force to be owner ddl: mitigate the issue that multiple owner might exist during force to be owner Oct 30, 2024
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 30, 2024
@@ -125,6 +125,8 @@ var (
domains: map[string]*domain.Domain{},
}
// store.UUID()-> IfBootstrapped
// TODO this memory flag is meaningless, a store is always bootstrapped once,
// we can always get the version from the store, remove it later.

Choose a reason for hiding this comment

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

How can we ensure this "TODO" can be tracked and done "later"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we have plans to refactor domain and bootstrap part to make it easier to test and maintain quality for further DDL/upgrade evolvement, i will add all TODOs as subtasks.

Copy link
Collaborator

@Benjamin2037 Benjamin2037 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Oct 31, 2024
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Oct 31, 2024
Copy link

ti-chi-bot bot commented Oct 31, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-10-31 07:03:35.294120263 +0000 UTC m=+506128.133275793: ☑️ agreed by Benjamin2037.
  • 2024-10-31 07:13:14.414407585 +0000 UTC m=+506707.253563128: ☑️ agreed by wjhuang2016.

Copy link

ti-chi-bot bot commented Oct 31, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Benjamin2037, Leavrth, wjhuang2016, 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 Oct 31, 2024
@ti-chi-bot ti-chi-bot bot merged commit 6679c74 into pingcap:master Oct 31, 2024
28 checks passed
@D3Hunter D3Hunter deleted the fix-force-leader branch October 31, 2024 16:54
@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-8.4 Should cherry pick this PR to release-8.4 branch. label Nov 1, 2024
@ti-chi-bot
Copy link
Member

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

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.4 Should cherry pick this PR to release-8.4 branch. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

upgrade from 7.5.3 to 8.4.0 failed
6 participants