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

lightning: always get latest PD leader when access PD after initialized #46726

Merged
merged 3 commits into from
Sep 7, 2023

Conversation

lance6716
Copy link
Contributor

@lance6716 lance6716 commented Sep 6, 2023

What problem does this PR solve?

Issue Number: close #46688 close #43436

Problem Summary:

What is changed and how it works?

PD nodes may change, so lightning should always try to use latest informtion rather than the addresses in task configuration.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • 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

Signed-off-by: lance6716 <lance6716@gmail.com>
@ti-chi-bot ti-chi-bot bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-triage-completed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 6, 2023
@tiprow
Copy link

tiprow bot commented Sep 6, 2023

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

@codecov
Copy link

codecov bot commented Sep 6, 2023

Codecov Report

Merging #46726 (287e2f2) into master (ca69622) will increase coverage by 1.6062%.
Report is 8 commits behind head on master.
The diff coverage is 82.7586%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #46726        +/-   ##
================================================
+ Coverage   73.3566%   74.9629%   +1.6062%     
================================================
  Files          1318       1360        +42     
  Lines        395847     402343      +6496     
================================================
+ Hits         290380     301608     +11228     
+ Misses        86993      81233      -5760     
- Partials      18474      19502      +1028     
Flag Coverage Δ
integration 33.9694% <82.7586%> (?)
unit 73.3073% <48.2758%> (-0.0493%) ⬇️

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

Components Coverage Δ
dumpling 54.0444% <ø> (ø)
parser 84.9805% <ø> (+0.0115%) ⬆️
br 65.1013% <82.7586%> (+12.6459%) ⬆️

@lance6716 lance6716 changed the title [WIP]lightning: always get latest PD leader after enter ImportTable [WIP]lightning: always get latest PD leader after initialized Sep 7, 2023
Signed-off-by: lance6716 <lance6716@gmail.com>
@lance6716 lance6716 changed the title [WIP]lightning: always get latest PD leader after initialized lightning: always get latest PD leader after initialized Sep 7, 2023
@ti-chi-bot ti-chi-bot bot removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-tests-checked labels Sep 7, 2023
func (p *PdController) getAllPDAddrs() []string {
ret := make([]string, 0, len(p.addrs)+1)
if p.pdClient != nil {
ret = append(ret, p.pdClient.GetLeaderAddr())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

PdController is shared by BR, @3pointer PTAL

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM

@lance6716
Copy link
Contributor Author

/check-issue-triage-complete

@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. and removed do-not-merge/needs-triage-completed labels Sep 7, 2023
@lance6716 lance6716 changed the title lightning: always get latest PD leader after initialized lightning: always get latest PD leader when access PD after initialized Sep 7, 2023
@lance6716
Copy link
Contributor Author

/test pull-br-integration-test

@tiprow
Copy link

tiprow bot commented Sep 7, 2023

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

In response to this:

/test pull-br-integration-test

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.

@D3Hunter
Copy link
Contributor

D3Hunter commented Sep 7, 2023

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Sep 7, 2023
@D3Hunter
Copy link
Contributor

D3Hunter commented Sep 7, 2023

/test pull-br-integration-test

@tiprow
Copy link

tiprow bot commented Sep 7, 2023

@D3Hunter: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test tiprow_fast_test

Use /test all to run all jobs.

In response to this:

/test pull-br-integration-test

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.

check_contains 'count(*): 4'
check_contains 'sum(c): 46'

restart_services
Copy link
Contributor

Choose a reason for hiding this comment

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

what's this for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the old pd is killed, I'm afraid other tests will access the dead pd by address

@ti-chi-bot ti-chi-bot bot added the approved label Sep 7, 2023
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Sep 7, 2023
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
Copy link

ti-chi-bot bot commented Sep 7, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Benjamin2037, D3Hunter

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 Sep 7, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Sep 7, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-09-07 05:44:21.922544933 +0000 UTC m=+2597026.471560904: ☑️ agreed by D3Hunter.
  • 2023-09-07 08:02:07.930624208 +0000 UTC m=+2605292.479640195: ☑️ agreed by Benjamin2037.

@lance6716
Copy link
Contributor Author

/retest

1 similar comment
@lance6716
Copy link
Contributor Author

/retest

@D3Hunter
Copy link
Contributor

D3Hunter commented Sep 7, 2023

/hold
wait lightning test

@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 Sep 7, 2023
@lance6716
Copy link
Contributor Author

/hold wait lightning test

lightning test passed before. You can see the commit hash is same
image
https://prow.tidb.net/?pull=46726

@lance6716
Copy link
Contributor Author

/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 Sep 7, 2023
@lance6716
Copy link
Contributor Author

/retest

@ti-chi-bot ti-chi-bot bot merged commit 41d1ec0 into pingcap:master Sep 7, 2023
25 of 29 checks passed
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Sep 7, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Sep 7, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ti-chi-bot bot pushed a commit that referenced this pull request Sep 11, 2023
ti-chi-bot bot pushed a commit that referenced this pull request Oct 17, 2023
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-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
5 participants