Browse Source

docs(topology): readability improvements (#3688)

Signed-off-by: Ryan Russell <git@ryanrussell.org>

Signed-off-by: Ryan Russell <git@ryanrussell.org>
pull/3693/head
Ryan Russell 2 years ago
committed by GitHub
parent
commit
a635973847
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      weed/topology/store_replicate.go
  2. 8
      weed/topology/volume_layout_test.go

2
weed/topology/store_replicate.go

@ -205,7 +205,7 @@ func GetWritableRemoteReplications(s *storage.Store, grpcDialOption grpc.DialOpt
// has one local and has remote replications // has one local and has remote replications
copyCount := v.ReplicaPlacement.GetCopyCount() copyCount := v.ReplicaPlacement.GetCopyCount()
if len(lookupResult.Locations) < copyCount { if len(lookupResult.Locations) < copyCount {
err = fmt.Errorf("replicating opetations [%d] is less than volume %d replication copy count [%d]",
err = fmt.Errorf("replicating operations [%d] is less than volume %d replication copy count [%d]",
len(lookupResult.Locations), volumeId, copyCount) len(lookupResult.Locations), volumeId, copyCount)
} }
} }

8
weed/topology/volume_layout_test.go

@ -54,7 +54,7 @@ func TestVolumesBinaryState(t *testing.T) {
expectResultAfterUpdate []bool expectResultAfterUpdate []bool
}{ }{
{ {
name: "mark true when exist copies",
name: "mark true when copies exist",
state: state_exist, state: state_exist,
expectResult: []bool{true, true, true, false, true}, expectResult: []bool{true, true, true, false, true},
update: func() { update: func() {
@ -67,7 +67,7 @@ func TestVolumesBinaryState(t *testing.T) {
expectResultAfterUpdate: []bool{true, false, true, false, false}, expectResultAfterUpdate: []bool{true, false, true, false, false},
}, },
{ {
name: "mark true when inexist copies",
name: "mark true when no copies exist",
state: state_no, state: state_no,
expectResult: []bool{false, true, true, false, true}, expectResult: []bool{false, true, true, false, true},
update: func() { update: func() {
@ -92,7 +92,7 @@ func TestVolumesBinaryState(t *testing.T) {
} }
for index, val := range result { for index, val := range result {
if val != test.expectResult[index] { if val != test.expectResult[index] {
t.Fatalf("result not matched, index %d, got %v, expect %v\n",
t.Fatalf("result not matched, index %d, got %v, expected %v\n",
index, val, test.expectResult[index]) index, val, test.expectResult[index])
} }
} }
@ -107,7 +107,7 @@ func TestVolumesBinaryState(t *testing.T) {
} }
for index, val := range updateResult { for index, val := range updateResult {
if val != test.expectResultAfterUpdate[index] { if val != test.expectResultAfterUpdate[index] {
t.Fatalf("update result not matched, index %d, got %v, expect %v\n",
t.Fatalf("update result not matched, index %d, got %v, expected %v\n",
index, val, test.expectResultAfterUpdate[index]) index, val, test.expectResultAfterUpdate[index])
} }
} }

Loading…
Cancel
Save