Skip to content

Commit

Permalink
storage/simulation: only rebalance 50% of ranges on each iteration so…
Browse files Browse the repository at this point in the history
… it will converge
  • Loading branch information
d4l3k committed Sep 1, 2016
1 parent dd3229a commit 4e29a36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion storage/simulation/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ func (c *Cluster) prepareActions() {
for storeID, rep := range r.replicas {
rep.action, rep.priority = r.allocator.ComputeAction(r.zone, &r.desc)
if rep.action == storage.AllocatorNoop {
if _, ok := r.getRebalanceTarget(storeID); ok {
if _, ok := r.getRebalanceTarget(storeID); ok && c.rand.Float64() < 0.5 {
rep.rebalance = true
// Set the priority to 1 so that rebalances will occur in
// performActions.
Expand Down

0 comments on commit 4e29a36

Please sign in to comment.