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
Store and replicate timestamp of file deletion in tombstone marker
Chris Lu85eae57e4ce9
diff --git a/weed/server/volume_server_handlers_write.go b/weed/server/volume_server_handlers_write.goindex 3864ec9034..55ef2a6139 100644--- a/weed/server/volume_server_handlers_write.go+++ b/weed/server/volume_server_handlers_write.go@@ -9,6 +9,8 @@ import ("github.com/chrislusf/seaweedfs/weed/operation""github.com/chrislusf/seaweedfs/weed/storage""github.com/chrislusf/seaweedfs/weed/topology"+ "time"+ "strconv")func (vs *VolumeServer) PostHandler(w http.ResponseWriter, r *http.Request) {@@ -87,6 +89,14 @@ func (vs *VolumeServer) DeleteHandler(w http.ResponseWriter, r *http.Request) {count = chunkManifest.Size}+ n.LastModified = uint64(time.Now().Unix())+ if len(r.FormValue("ts")) > 0 {+ modifiedTime, err := strconv.ParseInt(r.FormValue("ts"), 10, 64)+ if err == nil {+ n.LastModified = uint64(modifiedTime)+ }+ }+_, err := topology.ReplicatedDelete(vs.GetMaster(), vs.store, volumeId, n, r)if err == nil {@@ -103,6 +113,7 @@ func (vs *VolumeServer) DeleteHandler(w http.ResponseWriter, r *http.Request) {func (vs *VolumeServer) batchDeleteHandler(w http.ResponseWriter, r *http.Request) {r.ParseForm()var ret []operation.DeleteResult+ now := uint64(time.Now().Unix())for _, fid := range r.Form["fid"] {vid, id_cookie, err := operation.ParseFileId(fid)if err != nil {@@ -144,6 +155,7 @@ func (vs *VolumeServer) batchDeleteHandler(w http.ResponseWriter, r *http.Requesglog.V(0).Infoln("deleting", fid, "with unmaching cookie from ", r.RemoteAddr, "agent", r.UserAgent())return}+ n.LastModified = nowif size, err := vs.store.Delete(volumeId, n); err != nil {ret = append(ret, operation.DeleteResult{Fid: fid,