diff options
| author | chrislu <chris.lu@gmail.com> | 2022-09-14 23:06:44 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-09-14 23:06:44 -0700 |
| commit | 21c058790010aa9224568248f2d9bf9c324b6747 (patch) | |
| tree | ef2e2a1693c0563f8e44c099d1fee929f40863ff /weed/shell/command_volume_fix_replication.go | |
| parent | c8645fd2323d97164489e0429ed140f84002e61e (diff) | |
| download | seaweedfs-21c058790010aa9224568248f2d9bf9c324b6747.tar.xz seaweedfs-21c058790010aa9224568248f2d9bf9c324b6747.zip | |
go fmt
Diffstat (limited to 'weed/shell/command_volume_fix_replication.go')
| -rw-r--r-- | weed/shell/command_volume_fix_replication.go | 64 |
1 files changed, 35 insertions, 29 deletions
diff --git a/weed/shell/command_volume_fix_replication.go b/weed/shell/command_volume_fix_replication.go index c773f3904..33a18d8ee 100644 --- a/weed/shell/command_volume_fix_replication.go +++ b/weed/shell/command_volume_fix_replication.go @@ -70,7 +70,7 @@ func (c *commandVolumeFixReplication) Do(args []string, commandEnv *CommandEnv, } takeAction := !*skipChange - doDeletes := !*noDelete; + doDeletes := !*noDelete underReplicatedVolumeIdsCount := 1 for underReplicatedVolumeIdsCount > 0 { @@ -331,34 +331,40 @@ func keepDataNodesSorted(dataNodes []location, diskType types.DiskType) { } /* - if on an existing data node { - return false - } - if different from existing dcs { - if lack on different dcs { - return true - }else{ - return false - } - } - if not on primary dc { - return false - } - if different from existing racks { - if lack on different racks { - return true - }else{ - return false - } - } - if not on primary rack { - return false - } - if lacks on same rack { - return true - } else { - return false - } + if on an existing data node { + return false + } + + if different from existing dcs { + if lack on different dcs { + return true + }else{ + return false + } + } + + if not on primary dc { + return false + } + + if different from existing racks { + if lack on different racks { + return true + }else{ + return false + } + } + + if not on primary rack { + return false + } + + if lacks on same rack { + return true + } else { + + return false + } */ func satisfyReplicaPlacement(replicaPlacement *super_block.ReplicaPlacement, replicas []*VolumeReplica, possibleLocation location) bool { |
