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

replica checker: compare score then alloc peer. #673

Merged
merged 2 commits into from
Jul 4, 2017

Conversation

disksing
Copy link
Contributor

@disksing disksing commented Jul 4, 2017

Only alloc peer id if found a better replacement.
/cc @nolouch @huachaohuang

@nolouch
Copy link
Contributor

nolouch commented Jul 4, 2017

LGTM

Copy link
Contributor

@siddontang siddontang left a comment

Choose a reason for hiding this comment

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

LGTM

// selectBestPeer returns the best peer in other stores.
func (r *replicaChecker) selectBestPeer(region *RegionInfo, filters ...Filter) (*metapb.Peer, float64) {
// SelectBestStoreToAddReplica returns the store to add a replica.
func (r *replicaChecker) SelectBestStoreToAddReplica(region *RegionInfo, filters ...Filter) (uint64, float64) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a SelectBestPeerToAddReplica for convenience?

@huachaohuang
Copy link
Contributor

LGTM

@disksing disksing merged commit 5fb8eec into master Jul 4, 2017
@disksing disksing deleted the disksing/replica-check branch July 4, 2017 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants