Browse Source
Merge branch 'master' into commandVolumeCheckDisk
pull/6422/head
dsd
2 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
2 additions and
0 deletions
-
weed/shell/command_volume_fix_replication.go
|
|
@ -138,6 +138,7 @@ func (c *commandVolumeFixReplication) Do(args []string, commandEnv *CommandEnv, |
|
|
|
if underReplicatedVolumeIdsCount > 0 { |
|
|
|
// find the most underpopulated data nodes
|
|
|
|
fixedVolumeReplicas, err = c.fixUnderReplicatedVolumes(commandEnv, writer, *applyChanges, underReplicatedVolumeIds, volumeReplicas, allLocations, *retryCount, *volumesPerStep, *maxParallelization) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
@ -281,6 +282,7 @@ func (c *commandVolumeFixReplication) deleteOneVolume(commandEnv *CommandEnv, wr |
|
|
|
return nil |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (c *commandVolumeFixReplication) fixUnderReplicatedVolumes(commandEnv *CommandEnv, writer io.Writer, applyChanges bool, underReplicatedVolumeIds []uint32, volumeReplicas map[uint32][]*VolumeReplica, allLocations []location, retryCount int, volumesPerStep, maxParallelization int) (fixedVolumes map[string]int, err error) { |
|
|
|
fixedVolumes = map[string]int{} |
|
|
|
if len(underReplicatedVolumeIds) > volumesPerStep && volumesPerStep > 0 { |
|
|
|