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

schedule: fix split-merge-interval update #8405

Merged
merged 4 commits into from
Jul 17, 2024

Conversation

lhy1024
Copy link
Contributor

@lhy1024 lhy1024 commented Jul 16, 2024

What problem does this PR solve?

Issue Number: Close #8404

What is changed and how does it work?

Check List

Tests

  • Unit test
  • Manual test

test will failed with master branch

--- FAIL: TestMergeCheckerTestSuite (1.51s)
    --- FAIL: TestMergeCheckerTestSuite/TestBasic (1.51s)
        /home/lhy1024/pd/pkg/schedule/checker/merge_checker_test.go:261: 
            	Error Trace:	/home/lhy1024/pd/pkg/schedule/checker/merge_checker_test.go:261
            	Error:      	Expected value not to be nil.
            	Test:       	TestMergeCheckerTestSuite/TestBasic
FAIL

Release note

None.

Signed-off-by: lhy1024 <admin@liudos.us>
Copy link

codecov bot commented Jul 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.23%. Comparing base (5ec6af4) to head (49285b1).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8405   +/-   ##
=======================================
  Coverage   77.23%   77.23%           
=======================================
  Files         471      471           
  Lines       61728    61728           
=======================================
+ Hits        47674    47677    +3     
  Misses      10466    10466           
+ Partials     3588     3585    -3     
Flag Coverage Δ
unittests 77.23% <100.00%> (+<0.01%) ⬆️

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

Signed-off-by: lhy1024 <admin@liudos.us>
@ti-chi-bot ti-chi-bot bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 16, 2024
@@ -88,13 +90,16 @@ func (m *MergeChecker) Check(region *core.RegionInfo) []*operator.Operator {
return nil
}

// update the split cache.
// It must be called before the following merge checker logic.
m.splitCache.UpdateTTL(m.conf.GetSplitMergeInterval())
Copy link
Member

@rleungx rleungx Jul 17, 2024

Choose a reason for hiding this comment

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

BTW, will it have a risk? If the heartbeat is not sent in time?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It has the same behavior as before in this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At the same time, we wait until 90% of the heartbeats are collected before checking.

Copy link
Member

Choose a reason for hiding this comment

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

There still be 10% and merge check may create lots of scheduling?

Copy link
Contributor Author

@lhy1024 lhy1024 Jul 17, 2024

Choose a reason for hiding this comment

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

The behavior is similar in this case. For example, if split-merge-interval is set to 1s.
In the past, it would pass the recently started check and then run UpdateTTL
Now, it will run UpdateTTL first and then pass the recently started check.

Perhaps we can add a longer time before recently started check, such as expireTime := m.startTime.Add(m.conf.GetSplitMergeInterval()+5*time.Minute)

Or we can add a filter to check whether the region reports a heartbeat after PD started. Will L109 be helpful?

Copy link
Member

@okJiang okJiang left a comment

Choose a reason for hiding this comment

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

lgtm

pkg/schedule/checker/merge_checker_test.go Show resolved Hide resolved
Copy link
Contributor

ti-chi-bot bot commented Jul 17, 2024

@okJiang: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

lgtm

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: lhy1024 <admin@liudos.us>
Copy link
Contributor

ti-chi-bot bot commented Jul 17, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-17 03:07:58.003307323 +0000 UTC m=+409699.994248796: ☑️ agreed by rleungx.
  • 2024-07-17 05:37:51.158616181 +0000 UTC m=+418693.149557652: ☑️ agreed by nolouch.

Copy link
Contributor

ti-chi-bot bot commented Jul 17, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nolouch, okJiang, rleungx

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

@ti-chi-bot ti-chi-bot bot merged commit 1ad446e into tikv:master Jul 17, 2024
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-signoff: yes lgtm release-note-none size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

schedule: if aba modification occurs, split-merge-interval will not take effect
4 participants