aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_volume_fsck.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2024-09-29 20:47:16 -0700
committerchrislu <chris.lu@gmail.com>2024-09-29 20:47:16 -0700
commit190b2fc27637017cdd075331fd04b8cb0e5879b7 (patch)
tree93db54c4ad83af2b09eb7862380b8c634154e203 /weed/shell/command_volume_fsck.go
parent8111ec13bd06e4a9142a87640986de8c41d4b75a (diff)
parent20929f2a5753a04385be2378e698c8df762b3256 (diff)
downloadseaweedfs-origin/mq2.tar.xz
seaweedfs-origin/mq2.zip
Merge branch 'master' into mq2origin/mq2
Diffstat (limited to 'weed/shell/command_volume_fsck.go')
-rw-r--r--weed/shell/command_volume_fsck.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/weed/shell/command_volume_fsck.go b/weed/shell/command_volume_fsck.go
index acb0ee5ad..30d3ecd11 100644
--- a/weed/shell/command_volume_fsck.go
+++ b/weed/shell/command_volume_fsck.go
@@ -60,7 +60,7 @@ func (c *commandVolumeFsck) Name() string {
}
func (c *commandVolumeFsck) Help() string {
- return `check all volumes to find entries not used by the filer
+ return `check all volumes to find entries not used by the filer. It is optional and resource intensive.
Important assumption!!!
the system is all used by one filer.
@@ -79,6 +79,10 @@ func (c *commandVolumeFsck) Help() string {
`
}
+func (c *commandVolumeFsck) HasTag(tag CommandTag) bool {
+ return tag == ResourceHeavy
+}
+
func (c *commandVolumeFsck) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
fsckCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
@@ -359,12 +363,12 @@ func (c *commandVolumeFsck) findExtraChunksInVolumeServers(dataNodeVolumeIdToVIn
needleVID := needle.VolumeId(volumeId)
if isReadOnlyReplicas[volumeId] {
- err := markVolumeWritable(c.env.option.GrpcDialOption, needleVID, server, true)
+ err := markVolumeWritable(c.env.option.GrpcDialOption, needleVID, server, true, false)
if err != nil {
return fmt.Errorf("mark volume %d read/write: %v", volumeId, err)
}
fmt.Fprintf(c.writer, "temporarily marked %d on server %v writable for forced purge\n", volumeId, server)
- defer markVolumeWritable(c.env.option.GrpcDialOption, needleVID, server, false)
+ defer markVolumeWritable(c.env.option.GrpcDialOption, needleVID, server, false, false)
fmt.Fprintf(c.writer, "marked %d on server %v writable for forced purge\n", volumeId, server)
}