diff --git a/weed/command/scaffold/filer.toml b/weed/command/scaffold/filer.toml index 25c372e9d..c8cb70131 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 e14cf5190..e85f7a740 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) }