Browse Source

avoid counter is null

pull/1933/head
Konstantin Lebedev 4 years ago
parent
commit
020a5d40c3
  1. 5
      weed/shell/command_volume_check_disk.go

5
weed/shell/command_volume_check_disk.go

@ -130,6 +130,11 @@ func (c *commandVolumeCheckDisk) doVolumeCheckDisk(subtrahend, minuend *needle_m
}) })
fmt.Fprintf(writer, "volume %d %s has %d entries, %s missed %d entries\n", source.info.Id, source.location.dataNode.Id, counter, target.location.dataNode.Id, len(missingNeedles)) fmt.Fprintf(writer, "volume %d %s has %d entries, %s missed %d entries\n", source.info.Id, source.location.dataNode.Id, counter, target.location.dataNode.Id, len(missingNeedles))
if counter == 0 || len(missingNeedles) == 0 {
return nil
}
missingNeedlesFraction := float64(len(missingNeedles)) / float64(counter) missingNeedlesFraction := float64(len(missingNeedles)) / float64(counter)
if missingNeedlesFraction > nonRepairThreshold { if missingNeedlesFraction > nonRepairThreshold {
return fmt.Errorf( return fmt.Errorf(

Loading…
Cancel
Save