Skip to content

Commit

Permalink
storage : fix bug for the testrace of TestSystemZoneConfigs
Browse files Browse the repository at this point in the history
  • Loading branch information
a6802739 authored and a-robinson committed Dec 20, 2017
1 parent 5dded67 commit 21d4cd9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/storage/allocator.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,11 @@ func (a Allocator) RebalanceTarget(
StoreID: target.store.StoreID,
ReplicaID: rangeInfo.Desc.NextReplicaID,
}

// Deep-copy the Replicas slice since we'll mutate it.
desc := *rangeInfo.Desc
desc.Replicas = append([]roachpb.ReplicaDescriptor(nil), desc.Replicas...)

desc.Replicas = append(desc.Replicas, newReplica)
rangeInfo.Desc = &desc

Expand Down

0 comments on commit 21d4cd9

Please sign in to comment.