aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_volume_check_disk.go
diff options
context:
space:
mode:
authorKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2022-04-25 18:27:14 +0500
committerKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2022-04-25 18:27:14 +0500
commit67476d830a0001fe514b6482edebc518722fe9ba (patch)
tree5030c1029fe96046e727dbc936050ce8fd40c13d /weed/shell/command_volume_check_disk.go
parent42cc8d8aa35ab886ff85cbcc2d26e4297ddeda17 (diff)
downloadseaweedfs-67476d830a0001fe514b6482edebc518722fe9ba.tar.xz
seaweedfs-67476d830a0001fe514b6482edebc518722fe9ba.zip
volume.check.disk add param volumeId
Diffstat (limited to 'weed/shell/command_volume_check_disk.go')
-rw-r--r--weed/shell/command_volume_check_disk.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/weed/shell/command_volume_check_disk.go b/weed/shell/command_volume_check_disk.go
index 53284096d..daa64c1bd 100644
--- a/weed/shell/command_volume_check_disk.go
+++ b/weed/shell/command_volume_check_disk.go
@@ -45,6 +45,7 @@ func (c *commandVolumeCheckDisk) Do(args []string, commandEnv *CommandEnv, write
fsckCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
slowMode := fsckCommand.Bool("slow", false, "slow mode checks all replicas even file counts are the same")
verbose := fsckCommand.Bool("v", false, "verbose mode")
+ volumeId := fsckCommand.Uint("volumeId", 0, "the volume id")
applyChanges := fsckCommand.Bool("force", false, "apply the fix")
nonRepairThreshold := fsckCommand.Float64("nonRepairThreshold", 0.3, "repair when missing keys is not more than this limit")
if err = fsckCommand.Parse(args); err != nil {
@@ -70,6 +71,9 @@ func (c *commandVolumeCheckDisk) Do(args []string, commandEnv *CommandEnv, write
}
for _, replicas := range volumeReplicas {
+ if *volumeId > 0 && replicas[0].info.Id != uint32(*volumeId) {
+ continue
+ }
slices.SortFunc(replicas, func(a, b *VolumeReplica) bool {
return fileCount(a) > fileCount(b)
})