Skip to content

br: optimize communication with tikv stores. #31722#35147

Merged
ti-chi-bot merged 8 commits intopingcap:masterfrom
MoCuishle28:issue-31722
Jul 5, 2022
Merged

br: optimize communication with tikv stores. #31722#35147
ti-chi-bot merged 8 commits intopingcap:masterfrom
MoCuishle28:issue-31722

Conversation

@MoCuishle28
Copy link
Contributor

@MoCuishle28 MoCuishle28 commented Jun 5, 2022

Signed-off-by: Gaoming Zhang zhanggaoming028@gmail.com

What problem does this PR solve?

  1. Optimize communication with tikv stores.
  2. Add ResetSpeedLimit function to reset the speed-limit of TiKV after the restore phase is done.

Issue Number: close #31722

Problem Summary:
Need to optimize communication with tikv stores.

What is changed and how it works?

  1. Use the workPool field in the restore.Client to implement concurrent communication with TiKV stores.
  2. Remove the rateLimit field of FileImporter.
  3. Add ResetSpeedLimit function to reset the speed-limit of TiKV after the restore phase is done.

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: Gaoming Zhang <zhanggaoming028@gmail.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jun 5, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • 3pointer
  • fengou1

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Details

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-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 Jun 5, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Jun 5, 2022

@MoCuishle28
Copy link
Contributor Author

Question:

  1. Do We really need to reset the speed-limit of TiKV stores?
  2. How should the error returned by the ResetSpeedLimit function be handled? (Even if reset speed-limit fails, restore may still succeed.)

@MoCuishle28
Copy link
Contributor Author

/run-all-tests

@MoCuishle28
Copy link
Contributor Author

/run-integration-br-test

@3pointer
Copy link
Contributor

3pointer commented Jun 6, 2022

Question:

  1. Do We really need to reset the speed-limit of TiKV stores?
  2. How should the error returned by the ResetSpeedLimit function be handled? (Even if reset speed-limit fails, restore may still succeed.)

I think we should handle reset speed-limit since we may have multiple restorations. and we can ignore the error after some times retry for now. in future we may need a mechanism to set speed limit in ttl. like what we do in switchmode

Signed-off-by: Gaoming Zhang <zhanggaoming028@gmail.com>
@MoCuishle28
Copy link
Contributor Author

/run-integration-br-test

@MoCuishle28
Copy link
Contributor Author

/run-integration-br-test

Signed-off-by: Gaoming Zhang <zhanggaoming028@gmail.com>
@MoCuishle28
Copy link
Contributor Author

/run-integration-br-test

@MoCuishle28
Copy link
Contributor Author

/cc @3pointer @joccau @YuJuncen PTAL
(BTW, please help me add labels as I don't have permission to add labels yet.)

@ti-chi-bot
Copy link
Member

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

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

Details

In response to this:

/cc @3pointer @joccau @YuJuncen PTAL
(BTW, please help me add labels as I don't have permission to add labels yet.)

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.

@YuJuncen YuJuncen added the component/br This issue is related to BR of TiDB. label Jun 28, 2022
Signed-off-by: Gaoming Zhang <zhanggaoming028@gmail.com>
@MoCuishle28
Copy link
Contributor Author

/run-integration-br-test

}

opt := grpc.WithInsecure()
if rc.tlsConf != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

shall we move opt into workerPool?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we can move opt into workerPool. I have modified it. PTAL

Signed-off-by: Gaoming Zhang <zhanggaoming028@gmail.com>
@MoCuishle28
Copy link
Contributor Author

/run-integration-br-test

1 similar comment
@MoCuishle28
Copy link
Contributor Author

/run-integration-br-test

Copy link
Contributor

@3pointer 3pointer 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 added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 30, 2022
@MoCuishle28 MoCuishle28 requested a review from YuJuncen June 30, 2022 08:21
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jul 5, 2022
@3pointer
Copy link
Contributor

3pointer commented Jul 5, 2022

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

DetailsCommit hash: 36b55d6

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 5, 2022
@ti-chi-bot
Copy link
Member

@MoCuishle28: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Details

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 ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot merged commit d8dbab2 into pingcap:master Jul 5, 2022
morgo added a commit to morgo/tidb that referenced this pull request Jul 6, 2022
* upstream/master: (77 commits)
  infoschema: add a simply store for DM's SchemaTracker (pingcap#35954)
  planner: refactor "access object" related logic and prepare for binary plan (pingcap#35890)
  telemetry: Initialize telemetry asynchronously (pingcap#35898)
  sessionctx/variable: convert TiDBLogFileMaxDays and TiDBConfig to ScopeInstance (pingcap#35733)
  session, sessionctx/variable: ensure sysvars are always in lower case (pingcap#35659)
  *: add telemetry support for multi-schema change (pingcap#35977)
  topsql: compress plan instead of dropping it (pingcap#35973)
  *: use pdqsort to improve sort performance (pingcap#34404)
  ddl: refine GetDDLInfo function (pingcap#35969)
  *: Make the code cleaner in session.ExecutePreparedStmt (pingcap#35943)
  ddl: remove `onDropIndexes` (pingcap#35960)
  ddl: refine history job code (pingcap#35967)
  sessionctx,kv,planner: add system variable for fine_grained_shuffle (pingcap#35256)
  *: change remote cache (pingcap#35968)
  *: enable gosec (pingcap#35873)
  plancodec: fix a miss case in conversion (pingcap#35957)
  ddl: support drop indexes for multi-schema change (pingcap#35883)
  pdutil: fix unstable test TestPauseSchedulersByKeyRange (pingcap#35949)
  br: optimize communication with tikv stores. pingcap#31722 (pingcap#35147)
  txn: rename snapshot related methods in txnManager. (pingcap#35912)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/br This issue is related to BR of TiDB. 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. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

br: need to optimize communication with tikv stores.

6 participants