aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Lebedev <lebedev_k@tochka.com>2021-03-24 22:07:13 +0500
committerKonstantin Lebedev <lebedev_k@tochka.com>2021-03-24 22:07:13 +0500
commitdf6cf0a2fabe557a85427a865aa8256783555fae (patch)
tree674b49bffee2d06606a44069215d3d5136af9ffb
parent60972f1c9742f0eb10d712dae0d57459e7018a3d (diff)
downloadseaweedfs-df6cf0a2fabe557a85427a865aa8256783555fae.tar.xz
seaweedfs-df6cf0a2fabe557a85427a865aa8256783555fae.zip
nonRepairThreshold
-rw-r--r--weed/shell/command_volume_check_disk.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/weed/shell/command_volume_check_disk.go b/weed/shell/command_volume_check_disk.go
index a27c9a8ac..05caa72e9 100644
--- a/weed/shell/command_volume_check_disk.go
+++ b/weed/shell/command_volume_check_disk.go
@@ -49,7 +49,7 @@ func (c *commandVolumeCheckDisk) Do(args []string, commandEnv *CommandEnv, write
slowMode := fsckCommand.Bool("slow", false, "slow mode checks all replicas even file counts are the same")
verbose := fsckCommand.Bool("v", false, "verbose mode")
applyChanges := fsckCommand.Bool("force", false, "apply the fix")
- repairThreshold := fsckCommand.Float64("repairThreshold", 0.3, "repair when missing keys is not more than this limit")
+ nonRepairThreshold := fsckCommand.Float64("nonRepairThreshold", 0.3, "repair when missing keys is not more than this limit")
if err = fsckCommand.Parse(args); err != nil {
return nil
}
@@ -102,10 +102,10 @@ func (c *commandVolumeCheckDisk) Do(args []string, commandEnv *CommandEnv, write
}
// find and make up the differnces
- if err := c.doVolumeCheckDisk(aDB, bDB, a, b, *verbose, writer, *applyChanges, *repairThreshold); err != nil {
+ if err := c.doVolumeCheckDisk(aDB, bDB, a, b, *verbose, writer, *applyChanges, *nonRepairThreshold); err != nil {
return err
}
- if err := c.doVolumeCheckDisk(bDB, aDB, b, a, *verbose, writer, *applyChanges, *repairThreshold); err != nil {
+ if err := c.doVolumeCheckDisk(bDB, aDB, b, a, *verbose, writer, *applyChanges, *nonRepairThreshold); err != nil {
return err
}
replicas = replicas[1:]
@@ -115,7 +115,7 @@ func (c *commandVolumeCheckDisk) Do(args []string, commandEnv *CommandEnv, write
return nil
}
-func (c *commandVolumeCheckDisk) doVolumeCheckDisk(subtrahend, minuend *needle_map.MemDb, source, target *VolumeReplica, verbose bool, writer io.Writer, applyChanges bool, repairThreshold float64) error {
+func (c *commandVolumeCheckDisk) doVolumeCheckDisk(subtrahend, minuend *needle_map.MemDb, source, target *VolumeReplica, verbose bool, writer io.Writer, applyChanges bool, nonRepairThreshold float64) error {
// find missing keys
// hash join, can be more efficient
@@ -131,10 +131,10 @@ 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))
missingNeedlesFraction := float64(len(missingNeedles)) / float64(counter)
- if missingNeedlesFraction > repairThreshold {
+ if missingNeedlesFraction > nonRepairThreshold {
return fmt.Errorf(
"failed to start repair volume %d, percentage of missing keys is greater than the threshold: %.2f > %.2f",
- source.info.Id, missingNeedlesFraction, repairThreshold)
+ source.info.Id, missingNeedlesFraction, nonRepairThreshold)
}
for _, needleValue := range missingNeedles {