Skip to content

storage: rebalancing only considers range leader store #5737

@petermattis

Description

@petermattis

Rebalancing is performed by the "replicate queue" (storage/replicate_queue.go) which periodically checks every range it is a leader for and calls Allocator.ShouldRebalance. ShouldRebalance retrieves the store descriptor for the leader replica and calls balancer.improve which compares the store capacity/range-count against cluster averages. If rebalancing should be performed, a new replica is added and a subsequent pass of the "replicate queue" will take care of removing the "worst" replica in an over-replicated range.

There is a glitch in the above, though. If the leader replica for a range is on a "good" store while one of the other replicas is on a "bad" store, we won't perform rebalancing. balancer.improve should consider the worst replica store when making the rebalancing decision.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions