Navigation Menu

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

server/*: refactor AllocPeer #2073

Merged
merged 2 commits into from Jan 2, 2020
Merged

server/*: refactor AllocPeer #2073

merged 2 commits into from Jan 2, 2020

Conversation

disksing
Copy link
Contributor

@disksing disksing commented Jan 2, 2020

Signed-off-by: disksing i@disksing.com

What problem does this PR solve?

IDs may be wasted because AllocPeer is called too early. See #1924

Now we use operator.Builder to create operators. Since it supports allocating ID automatically, we can defer ID allocation to Builder.

What is changed and how it works?

  • allocate IDs in builder
  • change cluster.AllocPeer to cluster.AllocID. (some tests keeps using AllocPeer)

Check List

Tests

  • Unit test

Signed-off-by: disksing <i@disksing.com>
@disksing disksing added the component/schedule Scheduling logic. label Jan 2, 2020
@disksing disksing added this to the v4.0.0-beta milestone Jan 2, 2020
@codecov-io
Copy link

Codecov Report

Merging #2073 into master will increase coverage by 0.2%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #2073     +/-   ##
=========================================
+ Coverage   76.77%   76.98%   +0.2%     
=========================================
  Files         191      191             
  Lines       19332    19294     -38     
=========================================
+ Hits        14842    14853     +11     
+ Misses       3368     3339     -29     
+ Partials     1122     1102     -20
Impacted Files Coverage Δ
server/cluster/cluster.go 81.54% <ø> (+0.38%) ⬆️
server/schedule/operator/operator.go 95.91% <ø> (ø) ⬆️
server/schedule/region_scatterer.go 82.6% <100%> (+1.75%) ⬆️
server/schedulers/adjacent_region.go 76.47% <100%> (+1.99%) ⬆️
server/schedule/operator/builder.go 95.12% <100%> (ø) ⬆️
server/schedulers/shuffle_hot_region.go 69.79% <100%> (+2.11%) ⬆️
server/schedulers/hot_region.go 86.39% <100%> (+0.64%) ⬆️
server/schedule/checker/replica_checker.go 83.33% <100%> (+2.96%) ⬆️
server/handler.go 51.61% <100%> (+0.76%) ⬆️
server/schedulers/shuffle_region.go 84.28% <100%> (+3.2%) ⬆️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea974c9...1134ab7. Read the comment docs.

Copy link
Contributor

@lhy1024 lhy1024 left a comment

Choose a reason for hiding this comment

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

LGTM

server/schedulers/adjacent_region.go Show resolved Hide resolved
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

@disksing
Copy link
Contributor Author

disksing commented Jan 2, 2020

/merge

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jan 2, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Jan 2, 2020

/run-all-tests

@disksing
Copy link
Contributor Author

disksing commented Jan 2, 2020

CI problem. re-run.

@disksing
Copy link
Contributor Author

disksing commented Jan 2, 2020

/merge

1 similar comment
@lhy1024
Copy link
Contributor

lhy1024 commented Jan 2, 2020

/merge

@lhy1024
Copy link
Contributor

lhy1024 commented Jan 2, 2020

/run-all-tests

@sre-bot sre-bot merged commit 98cb268 into tikv:master Jan 2, 2020
@disksing disksing deleted the alloc-id branch January 10, 2020 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/schedule Scheduling logic. status/can-merge Indicates a PR has been approved by a committer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants