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

add ttl config to disable tikv split #5485

Merged
merged 15 commits into from Sep 13, 2022
Merged

Conversation

D3Hunter
Copy link
Contributor

@D3Hunter D3Hunter commented Sep 9, 2022

What problem does this PR solve?

Issue Number: Close #5486

ref: pingcap/tidb#35489

What is changed and how does it work?

  • add a ttl configuration to disable tikv split

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
    • max region size set to 10k
    • insert data until trigger region split
    • disable tikv split for 60s
    • insert data, see tikv report warning that ErrSchedulerTikvSplitDisabled
    • after ttl expired, insert some data, tikv can split normally.
  • No code

Code changes

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

Release note

None.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Sep 9, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • nolouch
  • rleungx

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.

Signed-off-by: D3Hunter <jujj603@gmail.com>
Signed-off-by: D3Hunter <jujj603@gmail.com>
Signed-off-by: D3Hunter <jujj603@gmail.com>
@codecov
Copy link

codecov bot commented Sep 9, 2022

Codecov Report

Base: 75.62% // Head: 75.60% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (3cac599) compared to base (5ca01a8).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5485      +/-   ##
==========================================
- Coverage   75.62%   75.60%   -0.02%     
==========================================
  Files         320      320              
  Lines       31622    31640      +18     
==========================================
+ Hits        23913    23923      +10     
- Misses       5645     5660      +15     
+ Partials     2064     2057       -7     
Flag Coverage Δ
unittests 75.60% <100.00%> (-0.02%) ⬇️

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

Impacted Files Coverage Δ
server/cluster/cluster_worker.go 70.00% <100.00%> (+1.03%) ⬆️
server/config/config.go 78.22% <100.00%> (+0.09%) ⬆️
server/config/persist_options.go 93.64% <100.00%> (+0.26%) ⬆️
pkg/dashboard/keyvisual/input/core.go 0.00% <0.00%> (-33.34%) ⬇️
server/id/id.go 83.05% <0.00%> (-3.39%) ⬇️
server/tso/allocator_manager.go 64.44% <0.00%> (-2.60%) ⬇️
server/schedule/hbstream/heartbeat_streams.go 72.72% <0.00%> (-2.03%) ⬇️
tools/pd-ctl/pdctl/command/operator.go 66.66% <0.00%> (-1.15%) ⬇️
pkg/btree/btree.go 86.26% <0.00%> (-0.97%) ⬇️
server/schedulers/evict_leader.go 78.57% <0.00%> (-0.90%) ⬇️
... and 15 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@JmPotato JmPotato left a comment

Choose a reason for hiding this comment

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

The rest LGTM. BTW, Do we need to do some error handling work on the TiKV-side to prevent something like outputting massive split error logs or unnecessary retries?

pkg/errs/errno.go Outdated Show resolved Hide resolved
Signed-off-by: D3Hunter <jujj603@gmail.com>
Signed-off-by: D3Hunter <jujj603@gmail.com>
@D3Hunter
Copy link
Contributor Author

D3Hunter commented Sep 9, 2022

ptal

@@ -200,6 +200,12 @@ const (
hotRegionScheduleLimitKey = "schedule.hot-region-schedule-limit"
schedulerMaxWaitingOperatorKey = "schedule.scheduler-max-waiting-operator"
enableLocationReplacement = "schedule.enable-location-replacement"
// it's related to schedule, but it's not an explicit config
enableTiKVSplitRegion = "schedule.enable-tikv-split-region"
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to add it to ScheduleConfig?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not necessary for now, it's not a real config(it's always true except during br operation)

can be deprecated when pd support one-api to pause all schedulers.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's ok to ScheduleConfig, in some scenarios, we also need to disable split. such as recovery

Copy link
Contributor Author

@D3Hunter D3Hunter Sep 9, 2022

Choose a reason for hiding this comment

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

198c7cc , it's visible internally for now(so cannot disable it without ttl)

@@ -100,9 +101,6 @@ func TestAskSplit(t *testing.T) {
Region: regions[0].GetMeta(),
}

_, err = rc.HandleAskSplit(req)
Copy link
Member

Choose a reason for hiding this comment

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

Why remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved to below lines

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Signed-off-by: D3Hunter <jujj603@gmail.com>
Signed-off-by: D3Hunter <jujj603@gmail.com>
Signed-off-by: D3Hunter <jujj603@gmail.com>
Signed-off-by: D3Hunter <jujj603@gmail.com>
Signed-off-by: D3Hunter <jujj603@gmail.com>
Signed-off-by: D3Hunter <jujj603@gmail.com>
server/config/config.go Outdated Show resolved Hide resolved
@rleungx
Copy link
Member

rleungx commented Sep 13, 2022

/rebuild

Co-authored-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: D3Hunter <jujj603@gmail.com>
server/config/persist_options.go Show resolved Hide resolved
server/config/config.go Outdated Show resolved Hide resolved
Signed-off-by: D3Hunter <jujj603@gmail.com>
Signed-off-by: D3Hunter <jujj603@gmail.com>
Copy link
Member

@rleungx rleungx 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 Sep 13, 2022
Copy link
Contributor

@nolouch nolouch 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 status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Sep 13, 2022
@nolouch
Copy link
Contributor

nolouch commented Sep 13, 2022

/merge

@ti-chi-bot
Copy link
Member

@nolouch: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

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
Copy link
Member

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

Commit hash: e62eec5

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 13, 2022
@ti-chi-bot ti-chi-bot merged commit 86262da into tikv:master Sep 13, 2022
@D3Hunter D3Hunter deleted the disable-split branch September 13, 2022 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none 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.

add a ttl configuration to disable tikv split
5 participants