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

backup,config: set backup thread pool size via config instead of gRPC (#8193) #8199

Merged
merged 3 commits into from Jul 15, 2020

Conversation

ti-srebot
Copy link
Contributor

cherry-pick #8193 to release-4.0


What problem does this PR solve?

Issue Number: close pingcap/br#394, close #8076.

Problem Summary:

What is changed and how it works?

This is the companion PR of pingcap/br#396.

In #5553, the backup component gained ability to an adjustable thread pool size. The size is provided via the incoming gRPC request. Given how the ThreadPool is implemented in TiKV, a user can easily (accidentally) DoS all TiKV servers by setting the thread pool size to a huge number like 232-1.

Furthermore, when we provide the thread pool size through gRPC, the backup client (BR) must determine the suitable concurrency number in some ad-hoc way.

This PR solves both issue by moving the thread pool size back as a TiKV config:

[backup]
num-threads = 24

The default value is set to (0.75 × Number of CPUs) to better utilize the available resources. The value can still be dynamically configured, but given this more practical default value it should be much less needed.

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • PR to update pingcap/tidb-ansible:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test

Side effects

Release note

  • A new configuration backup.num-threads is introduced to control the backup thread pool size.

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot ti-srebot added component/backup-restore Component: backup, import, external_storage sig/migrate status/PTAL Status: Waiting for reviewing type/cherry-pick Type: PR - Cherry pick type/enhancement Type: Issue - Enhancement labels Jul 6, 2020
@ti-srebot ti-srebot added this to the v4.0.1 milestone Jul 6, 2020
@ti-srebot
Copy link
Contributor Author

@kennytm please accept the invitation then you can push to the cherry-pick pull requests.
https://github.com/ti-srebot/tikv/invitations

@overvenus overvenus modified the milestones: v4.0.1, v4.0.3 Jul 6, 2020
@overvenus
Copy link
Member

Please fix the conflicts.

Signed-off-by: kennytm <kennytm@gmail.com>
@kennytm
Copy link
Contributor

kennytm commented Jul 12, 2020

/run-integration-compatibility-test
/run-integration-ddl-test

@kennytm kennytm requested review from overvenus and NingLin-P and removed request for overvenus July 12, 2020 20:21
@kennytm
Copy link
Contributor

kennytm commented Jul 13, 2020

/run-integration-ddl-test

@ti-srebot ti-srebot added the status/LGT1 Status: PR - There is already 1 approval label Jul 14, 2020
@overvenus
Copy link
Member

/run-integration-br-test

@MyonKeminta
Copy link
Contributor

/merge

@ti-srebot ti-srebot added the status/can-merge Status: Can merge to base branch label Jul 15, 2020
@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot ti-srebot merged commit d4af9ad into tikv:release-4.0 Jul 15, 2020
lichunzhu added a commit to lichunzhu/tidb-operator that referenced this pull request Jul 16, 2020
DanielZhangQD added a commit to pingcap/tidb-operator that referenced this pull request Jul 17, 2020
* add pd EnableTelemetry argument, related PR: tikv/pd#2654

* add tikv backup config, related PR: tikv/tikv#8199

* re-generate code

* address comments

* address comment

Co-authored-by: DanielZhangQD <36026334+DanielZhangQD@users.noreply.github.com>
@kennytm kennytm deleted the release-4.0-0be3dfb4d5f1 branch July 27, 2020 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/backup-restore Component: backup, import, external_storage sig/migrate status/can-merge Status: Can merge to base branch status/LGT1 Status: PR - There is already 1 approval status/PTAL Status: Waiting for reviewing type/cherry-pick Type: PR - Cherry pick type/enhancement Type: Issue - Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants