aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-04-22 23:23:23 -0700
committerChris Lu <chris.lu@gmail.com>2021-04-22 23:23:23 -0700
commit89eb9f6e7073460838699b9c3a42f2cb830f8224 (patch)
tree4bec2580b9a508fee62d61dc3f4458ed0a1b31bb
parent46ef1811a18e4a6e704be801b55884fd1d40c9a8 (diff)
downloadseaweedfs-89eb9f6e7073460838699b9c3a42f2cb830f8224.tar.xz
seaweedfs-89eb9f6e7073460838699b9c3a42f2cb830f8224.zip
clean up .uploads directory in mysql and postgres tables
fix https://github.com/chrislusf/seaweedfs/issues/1957 When no uploads are running, you can run this SQL to clean up. delete from <bucket_name> where directory like '/.uploads/%'
-rw-r--r--weed/filer/abstract_sql/abstract_sql_store.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/weed/filer/abstract_sql/abstract_sql_store.go b/weed/filer/abstract_sql/abstract_sql_store.go
index 120a1d139..ab8f6bcbd 100644
--- a/weed/filer/abstract_sql/abstract_sql_store.go
+++ b/weed/filer/abstract_sql/abstract_sql_store.go
@@ -276,7 +276,9 @@ func (store *AbstractSqlStore) DeleteFolderChildren(ctx context.Context, fullpat
}
}
- res, err := db.ExecContext(ctx, store.GetSqlDeleteFolderChildren(bucket), util.HashStringToLong(string(shortPath)), fullpath)
+ glog.V(4).Infof("delete %s SQL %s %d", string(shortPath), store.GetSqlDeleteFolderChildren(bucket), util.HashStringToLong(string(shortPath)))
+
+ res, err := db.ExecContext(ctx, store.GetSqlDeleteFolderChildren(bucket), util.HashStringToLong(string(shortPath)), string(shortPath))
if err != nil {
return fmt.Errorf("deleteFolderChildren %s: %s", fullpath, err)
}