SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
filer: optional recursive deletion
Chris Lu86d4b18eb5e7
diff --git a/weed/command/scaffold.go b/weed/command/scaffold.goindex a76466ed6d..8519598b3f 100644--- a/weed/command/scaffold.go+++ b/weed/command/scaffold.go@@ -59,16 +59,25 @@ const (# $HOME/.seaweedfs/filer.toml# /etc/seaweedfs/filer.toml+####################################################+# Customizable filer server options+####################################################+[filer.options]+# with http DELETE, by default the filer would check whether a folder is empty.+# recursive_delete will delete all sub folders and files, similar to "rm -Rf"+recursive_delete = false+++####################################################+# The following are filer store options+####################################################+[leveldb2]# local on disk, mostly for simple single-machine setup, fairly scalable# faster than previous leveldb, recommended.enabled = truedir = "." # directory to store level db files-####################################################-# multiple filers on shared storage, fairly scalable-####################################################-[mysql] # or tidb# CREATE TABLE IF NOT EXISTS filemeta (# dirhash BIGINT COMMENT 'first 64 bits of MD5 hash value of directory field',diff --git a/weed/server/filer_server.go b/weed/server/filer_server.goindex 41ba81366e..c703b8c6f4 100644--- a/weed/server/filer_server.go+++ b/weed/server/filer_server.go@@ -7,11 +7,14 @@ import ("os""time"+ "google.golang.org/grpc"+"github.com/chrislusf/seaweedfs/weed/operation""github.com/chrislusf/seaweedfs/weed/pb/master_pb""github.com/chrislusf/seaweedfs/weed/stats""github.com/chrislusf/seaweedfs/weed/util"- "google.golang.org/grpc"++ "github.com/spf13/viper""github.com/chrislusf/seaweedfs/weed/filer2"_ "github.com/chrislusf/seaweedfs/weed/filer2/cassandra"@@ -30,7 +33,6 @@ import (_ "github.com/chrislusf/seaweedfs/weed/notification/kafka"_ "github.com/chrislusf/seaweedfs/weed/notification/log""github.com/chrislusf/seaweedfs/weed/security"- "github.com/spf13/viper")type FilerOption struct {@@ -45,6 +47,7 @@ type FilerOption struct {DefaultLevelDbDir stringDisableHttp boolPort int+ recursiveDelete bool}type FilerServer struct {@@ -80,6 +83,7 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption)}util.LoadConfiguration("notification", false)+ fs.option.recursiveDelete = v.GetBool("filer.options.recursive_delete")fs.filer.LoadConfiguration(v)notification.LoadConfiguration(v.Sub("notification"))diff --git a/weed/server/filer_server_handlers_write.go b/weed/server/filer_server_handlers_write.goindex 236e7027dc..a7dcc39a09 100644--- a/weed/server/filer_server_handlers_write.go+++ b/weed/server/filer_server_handlers_write.go@@ -284,6 +284,11 @@ func (fs *FilerServer) uploadToVolumeServer(r *http.Request, u *url.URL, auth sefunc (fs *FilerServer) DeleteHandler(w http.ResponseWriter, r *http.Request) {isRecursive := r.FormValue("recursive") == "true"+ if !isRecursive && fs.option.recursiveDelete {+ if r.FormValue("recursive") != "false" {+ isRecursive = true+ }+ }ignoreRecursiveError := r.FormValue("ignoreRecursiveError") == "true"skipChunkDeletion := r.FormValue("skipChunkDeletion") == "true"