aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2022-04-25 23:10:01 +0500
committerKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2022-04-25 23:10:01 +0500
commitae56b2c00f8db6cd5b6958b755c24aaf0e753215 (patch)
tree5743a2d182abb1c808a4e9336b700872829e224c
parent6d2fda27d21d98aa73b072bd48ab0c3bf7c76281 (diff)
downloadseaweedfs-ae56b2c00f8db6cd5b6958b755c24aaf0e753215.tar.xz
seaweedfs-ae56b2c00f8db6cd5b6958b755c24aaf0e753215.zip
change forcePurging to a pointer
-rw-r--r--weed/shell/command_volume_fsck.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/shell/command_volume_fsck.go b/weed/shell/command_volume_fsck.go
index e950c0b0e..c79b062f7 100644
--- a/weed/shell/command_volume_fsck.go
+++ b/weed/shell/command_volume_fsck.go
@@ -34,7 +34,7 @@ func init() {
type commandVolumeFsck struct {
env *CommandEnv
- forcePurging bool
+ forcePurging *bool
}
func (c *commandVolumeFsck) Name() string {
@@ -69,7 +69,7 @@ func (c *commandVolumeFsck) Do(args []string, commandEnv *CommandEnv, writer io.
findMissingChunksInFilerPath := fsckCommand.String("findMissingChunksInFilerPath", "/", "used together with findMissingChunksInFiler")
findMissingChunksInVolumeId := fsckCommand.Int("findMissingChunksInVolumeId", 0, "used together with findMissingChunksInFiler")
applyPurging := fsckCommand.Bool("reallyDeleteFromVolume", false, "<expert only!> after detection, delete missing data from volumes / delete missing file entries from filer")
- c.forcePurging = *fsckCommand.Bool("forcePurging", false, "delete missing data from volumes in one replica")
+ c.forcePurging = fsckCommand.Bool("forcePurging", false, "delete missing data from volumes in one replica")
purgeAbsent := fsckCommand.Bool("reallyDeleteFilerEntries", false, "<expert only!> delete missing file entries from filer if the corresponding volume is missing for any reason, please ensure all still existing/expected volumes are connected! used together with findMissingChunksInFiler")
tempPath := fsckCommand.String("tempPath", path.Join(os.TempDir()), "path for temporary idx files")
@@ -295,7 +295,7 @@ func (c *commandVolumeFsck) findExtraChunksInVolumeServers(dataNodeVolumeIdToVIn
}
orphanFileIds := []string{}
for fid, foundInAllReplicas := range orphanReplicaFileIds {
- if !isSeveralReplicas[volumeId] || c.forcePurging || (isSeveralReplicas[volumeId] && foundInAllReplicas) {
+ if !isSeveralReplicas[volumeId] || *c.forcePurging || (isSeveralReplicas[volumeId] && foundInAllReplicas) {
orphanFileIds = append(orphanFileIds, fid)
}
}