diff options
| author | chrislu <chris.lu@gmail.com> | 2022-09-17 10:18:14 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-09-17 10:18:14 -0700 |
| commit | 1c79301f89762ed25a431bcb5f4e02858dc02218 (patch) | |
| tree | d0d6c5c44f7524ec38d7002e393d194769278649 /weed/shell/command_volume_fix_replication.go | |
| parent | 956ce6416fae66646344782cc7f6f557708eb1f4 (diff) | |
| parent | 3fc261d27c90fc06c1d555dd998d7535b844a746 (diff) | |
| download | seaweedfs-1c79301f89762ed25a431bcb5f4e02858dc02218.tar.xz seaweedfs-1c79301f89762ed25a431bcb5f4e02858dc02218.zip | |
Merge branch 'master' into message_send
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 { |
