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
doIsEmpty() return error if v.DataBackend is nil (#4587)
Bai Jie44b9d72ef0ac
diff --git a/weed/storage/volume.go b/weed/storage/volume.goindex 81c466f8f8..b1f5e6c12b 100644--- a/weed/storage/volume.go+++ b/weed/storage/volume.go@@ -134,16 +134,20 @@ func (v *Volume) ContentSize() uint64 {}func (v *Volume) doIsEmpty() (bool, error) {- if v.DataBackend != nil {+ // check v.DataBackend.GetStat()+ if v.DataBackend == nil {+ return false, fmt.Errorf("v.DataBackend is nil")+ } else {datFileSize, _, e := v.DataBackend.GetStat()if e != nil {glog.V(0).Infof("Failed to read file size %s %v", v.DataBackend.Name(), e)- return false, e+ return false, fmt.Errorf("v.DataBackend.GetStat(): %v", e)}if datFileSize > super_block.SuperBlockSize {return false, nil}}+ // check v.nm.ContentSize()if v.nm != nil {if v.nm.ContentSize() > 0 {return false, nil