This commit is contained in:
Chris Lu
2020-04-05 00:52:31 -07:00
parent bf270d9e8c
commit dcc6b6a3ed
4 changed files with 30 additions and 19 deletions

View File

@@ -213,7 +213,7 @@ func satisfyReplicaPlacement(replicaPlacement *super_block.ReplicaPlacement, exi
// now this is one of the primary dcs
existingRacks := make(map[string]int)
for _, loc := range existingLocations {
if loc.DataCenter()!=possibleLocation.DataCenter() {
if loc.DataCenter() != possibleLocation.DataCenter() {
continue
}
existingRacks[loc.Rack()] += 1

View File

@@ -14,6 +14,7 @@ type testcase struct {
possibleLocation location
expected bool
}
func TestSatisfyReplicaPlacementComplicated(t *testing.T) {
var tests = []testcase{