Skip to content

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.

Add deleterange_concurrency to filer configuration file

yulai.lic1dc5ab4ac90
diff --git a/weed/command/scaffold/filer.toml b/weed/command/scaffold/filer.toml
index 25c372e9d5..c8cb701312 100644
--- a/weed/command/scaffold/filer.toml
+++ b/weed/command/scaffold/filer.toml
@@ -236,3 +236,5 @@ enabled = false
# If you have many pd address, use ',' split then:
# pdaddrs = "pdhost1:2379, pdhost2:2379, pdhost3:2379"
pdaddrs = "localhost:2379"
+# Concurrency for TiKV delete range
+deleterange_concurrency = 1
diff --git a/weed/filer/tikv/tikv_store.go b/weed/filer/tikv/tikv_store.go
index e14cf5190e..e85f7a740e 100644
--- a/weed/filer/tikv/tikv_store.go
+++ b/weed/filer/tikv/tikv_store.go
@@ -16,6 +16,10 @@ import (
"github.com/tikv/client-go/v2/txnkv"
)
+var (
+ _ filer.FilerStore = ((*TikvStore)(nil))
+)
+
func init() {
filer.Stores = append(filer.Stores, &TikvStore{})
}
@@ -36,7 +40,11 @@ func (store *TikvStore) Initialize(config util.Configuration, prefix string) err
for _, item := range strings.Split(pdAddrsStr, ",") {
pdAddrs = append(pdAddrs, strings.TrimSpace(item))
}
- store.deleteRangeConcurrency = 1
+ drc := config.GetInt(prefix + "deleterange_concurrency")
+ if drc <= 0 {
+ drc = 1
+ }
+ store.deleteRangeConcurrency = drc
return store.initialize(pdAddrs)
}