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

prepare_snap: establish connection to all stores before pausing admin #51449

Merged
merged 2 commits into from
Mar 13, 2024

Conversation

YuJuncen
Copy link
Contributor

@YuJuncen YuJuncen commented Mar 1, 2024

What problem does this PR solve?

Issue Number: close #51448

Problem Summary:
Now if we cannot connect to a TiKV, it will block at creating connection.
But, in this scenario, some of TiKVs' admin commands are paused. That will impact the TP workload more.

What changed and how does it work?

After this PR, we won't pause the admin commands before connections to all TiKV nodes established.

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.

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

Signed-off-by: Yu Juncen <yu745514916@live.com>
@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. labels Mar 1, 2024
Copy link

tiprow bot commented Mar 1, 2024

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

Copy link

codecov bot commented Mar 1, 2024

Codecov Report

Merging #51449 (5129f10) into master (8e7658d) will increase coverage by 1.7011%.
Report is 126 commits behind head on master.
The diff coverage is 62.2222%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #51449        +/-   ##
================================================
+ Coverage   70.6487%   72.3499%   +1.7011%     
================================================
  Files          1462       1475        +13     
  Lines        435031     454834     +19803     
================================================
+ Hits         307344     329072     +21728     
+ Misses       108388     105728      -2660     
- Partials      19299      20034       +735     
Flag Coverage Δ
integration 47.1167% <0.0000%> (?)
unit 70.4848% <62.2222%> (+0.0456%) ⬆️

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

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 46.6229% <62.2222%> (+0.7779%) ⬆️

clients[store.Id] = cli
}

for id, cli := range clients {
Copy link
Contributor

Choose a reason for hiding this comment

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

why use two loops? seems it can be done without clients map

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 first createAndCacheStream must happens after ALL connections established. I think we cannot remove this. Or would you give a code snippet?

Copy link
Contributor

Choose a reason for hiding this comment

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

for _, store := range stores {
	cli, err := p.env.ConnectToStore(ctx, store.Id)
	if err != nil {
		return errors.Annotatef(err, "failed to dial the store %d", store.Id)
	}
    if err := p.createAndCacheStream(ctx, cli, store.Id); err != nil {
		return errors.Annotatef(err, "failed to create and cache stream for store %d", id)
	}	
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

THis will make createAndCacheStream concurrency with ConnectToStore, recall that:

The first createAndCacheStream must happens after ALL connections established.

Copy link
Contributor

Choose a reason for hiding this comment

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

...then what's problem with that?

@YuJuncen
Copy link
Contributor Author

YuJuncen commented Mar 7, 2024

/unit-test

@YuJuncen
Copy link
Contributor Author

YuJuncen commented Mar 7, 2024

/test unit-test

Copy link

tiprow bot commented Mar 7, 2024

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

In response to this:

/test unit-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.

Signed-off-by: Yu Juncen <yu745514916@live.com>
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Mar 7, 2024
@BornChanger
Copy link
Contributor

/retest

Copy link

tiprow bot commented Mar 11, 2024

@BornChanger: 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/test-infra repository.

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Mar 11, 2024
Copy link

ti-chi-bot bot commented Mar 11, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-03-07 05:37:43.507296883 +0000 UTC m=+318290.529543271: ☑️ agreed by 3pointer.
  • 2024-03-11 15:23:28.04959112 +0000 UTC m=+699035.071837507: ☑️ agreed by BornChanger.

@BornChanger
Copy link
Contributor

/retest

Copy link

tiprow bot commented Mar 12, 2024

@BornChanger: 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/test-infra repository.

@BornChanger
Copy link
Contributor

/retest

Copy link

tiprow bot commented Mar 12, 2024

@BornChanger: 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/test-infra repository.

@BornChanger
Copy link
Contributor

/retest

Copy link

tiprow bot commented Mar 12, 2024

@BornChanger: 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/test-infra repository.

@BornChanger
Copy link
Contributor

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Mar 12, 2024
@YuJuncen
Copy link
Contributor Author

/retest-required

Copy link

ti-chi-bot bot commented Mar 13, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 3pointer, BornChanger

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

Copy link

tiprow bot commented Mar 13, 2024

@YuJuncen: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
tidb_parser_test 45358ed link true /test tidb_parser_test

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@ti-chi-bot ti-chi-bot bot merged commit 7a62f45 into pingcap:master Mar 13, 2024
26 of 31 checks passed
@BornChanger
Copy link
Contributor

/label needs-cherry-pick-release-6.5

@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. label Mar 13, 2024
@ti-chi-bot
Copy link
Member

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

@YuJuncen
Copy link
Contributor Author

/retest-required

@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

mittalrishabh pushed a commit to mittalrishabh/tidb that referenced this pull request May 6, 2024
…pingcap#51449) (pingcap#51) (pingcap#63)

close pingcap#51448

Co-authored-by: 山岚 <36239017+YuJuncen@users.noreply.github.com>
mittalrishabh pushed a commit to mittalrishabh/tidb that referenced this pull request May 30, 2024
…pingcap#51449) (pingcap#51)

close pingcap#51448

Co-authored-by: 山岚 <36239017+YuJuncen@users.noreply.github.com>
mittalrishabh pushed a commit to mittalrishabh/tidb that referenced this pull request May 30, 2024
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. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.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/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.

disk_snapshot_backup: pause admin after all connections established.
4 participants