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: auto adjust dynamic region configuration #34537

Merged
merged 17 commits into from May 16, 2022

Conversation

lichunzhu
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #34536

Problem Summary:

What is changed and how it works?

auto adjust dynamic region configuration according to tikv's configuration.

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • None

Release note

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

lightning: auto adjust dynamic region split configuration

@ti-chi-bot
Copy link
Member

ti-chi-bot commented May 10, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • D3Hunter
  • gozssky

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.

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 do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 10, 2022
@sre-bot
Copy link
Contributor

sre-bot commented May 10, 2022

@lichunzhu lichunzhu marked this pull request as ready for review May 13, 2022 09:31
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 13, 2022
@lichunzhu lichunzhu added the component/lightning This issue is related to Lightning of TiDB. label May 13, 2022
@lichunzhu
Copy link
Contributor Author

/cc @gozssky @dsdashun

@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 16, 2022
br/pkg/lightning/backend/local/local.go Outdated Show resolved Hide resolved
br/pkg/lightning/restore/table_restore.go Outdated Show resolved Hide resolved
br/pkg/lightning/backend/local/local.go Outdated Show resolved Hide resolved
Copy link
Contributor

@sleepymole sleepymole left a comment

Choose a reason for hiding this comment

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

rest LGTM

br/pkg/lightning/backend/local/local.go Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label May 16, 2022
@sleepymole
Copy link
Contributor

/run-integration-br-test

@lichunzhu
Copy link
Contributor Author

/run-unit-test

Copy link
Contributor

@D3Hunter D3Hunter left a comment

Choose a reason for hiding this comment

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

rest lgtm

Comment on lines +937 to +943
if regionSplitKeys == 0 {
if regionSplitSize > int64(config.SplitRegionSize) {
regionSplitKeys = int64(float64(regionSplitSize) / float64(config.SplitRegionSize) * float64(config.SplitRegionKeys))
} else {
regionSplitKeys = int64(config.SplitRegionKeys)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

those code seems more like adjusting, maybe move into config.Adjust()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These codes are adjusting. However it's a bit hard to put them in config.Adjust() because some extra instances are needed. Maybe left a TODO here and refactor this in the next PR?

@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 May 16, 2022
@lichunzhu
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 820cdee

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label May 16, 2022
@lichunzhu
Copy link
Contributor Author

/run-integration-br-test

@lichunzhu
Copy link
Contributor Author

@ti-chi-bot ti-chi-bot merged commit 6d43ec7 into pingcap:master May 16, 2022
@lichunzhu lichunzhu deleted the dynamicRegion branch May 16, 2022 09:27
@sre-bot
Copy link
Contributor

sre-bot commented May 16, 2022

TiDB MergeCI notify

🔴 Bad News! New failing [1] after this pr merged.
These new failed integration tests seem to be caused by the current PR, please try to fix these new failed integration tests, thanks!

CI Name Result Duration Compare with Parent commit
idc-jenkins-ci-tidb/integration-compatibility-test 🟥 failed 1, success 0, total 1 15 min New failing
idc-jenkins-ci/integration-cdc-test 🟢 all 34 tests passed 26 min Existing passed
idc-jenkins-ci-tidb/tics-test 🟢 all 1 tests passed 26 min Existing passed
idc-jenkins-ci-tidb/integration-common-test 🟢 all 11 tests passed 23 min Existing passed
idc-jenkins-ci-tidb/sqllogic-test-1 🟢 all 26 tests passed 10 min Existing passed
idc-jenkins-ci-tidb/sqllogic-test-2 🟢 all 28 tests passed 9 min 33 sec Existing passed
idc-jenkins-ci-tidb/common-test 🟢 all 12 tests passed 8 min 34 sec Existing passed
idc-jenkins-ci-tidb/integration-ddl-test 🟢 all 6 tests passed 7 min 51 sec Existing passed
idc-jenkins-ci-tidb/mybatis-test 🟢 all 1 tests passed 4 min 33 sec Existing passed
idc-jenkins-ci-tidb/plugin-test 🟢 build success, plugin test success 4min Existing passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/lightning This issue is related to Lightning of TiDB. 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.

lightning: adapt the new dynamic region feature
5 participants