diff options
Diffstat (limited to 'weed/topology/data_node_ec.go')
| -rw-r--r-- | weed/topology/data_node_ec.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/weed/topology/data_node_ec.go b/weed/topology/data_node_ec.go index ef395dbdb..e8ead5511 100644 --- a/weed/topology/data_node_ec.go +++ b/weed/topology/data_node_ec.go @@ -18,23 +18,23 @@ func (dn *DataNode) UpdateEcShards(actualShards []*erasure_coding.EcVolumeInfo) // prepare the new ec shard map actualEcShardMap := make(map[needle.VolumeId]*erasure_coding.EcVolumeInfo) for _, ecShards := range actualShards { - actualEcShardMap[ecShards.VolumeId]= ecShards + actualEcShardMap[ecShards.VolumeId] = ecShards } // found out the newShards and deletedShards dn.ecShardsLock.RLock() - for vid, ecShards := range dn.ecShards{ + for vid, ecShards := range dn.ecShards { if actualEcShards, ok := actualEcShardMap[vid]; !ok { // dn registered ec shards not found in the new set of ec shards deletedShards = append(deletedShards, ecShards) } else { // found, but maybe the actual shard could be missing a := actualEcShards.Minus(ecShards) - if len(a.ShardIds())>0 { + if len(a.ShardIds()) > 0 { newShards = append(newShards, a) } d := ecShards.Minus(actualEcShards) - if len(d.ShardIds())>0 { + if len(d.ShardIds()) > 0 { deletedShards = append(deletedShards, d) } } @@ -46,7 +46,7 @@ func (dn *DataNode) UpdateEcShards(actualShards []*erasure_coding.EcVolumeInfo) } dn.ecShardsLock.RUnlock() - if len(newShards)>0 || len(deletedShards)>0{ + if len(newShards) > 0 || len(deletedShards) > 0 { // if changed, set to the new ec shard map dn.ecShardsLock.Lock() dn.ecShards = actualEcShardMap |
