aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/volume.go
diff options
context:
space:
mode:
authorKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2023-06-13 10:22:46 +0500
committerGitHub <noreply@github.com>2023-06-12 22:22:46 -0700
commit4527ead2956c31f3ffca98e7c5af13a3d5b92f1e (patch)
treed59fc1802fce5d1d56fe5b989f6e036f34099620 /weed/storage/volume.go
parenta25bca06927a171ba1d8d459e573bc083ca8c1a8 (diff)
downloadseaweedfs-4527ead2956c31f3ffca98e7c5af13a3d5b92f1e.tar.xz
seaweedfs-4527ead2956c31f3ffca98e7c5af13a3d5b92f1e.zip
fix from comment delete volume is empty (#4573)
* fix from coments https://github.com/seaweedfs/seaweedfs/pull/4561 * fix tests --------- Co-authored-by: Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.co>
Diffstat (limited to 'weed/storage/volume.go')
-rw-r--r--weed/storage/volume.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/weed/storage/volume.go b/weed/storage/volume.go
index 31960451c..066f06604 100644
--- a/weed/storage/volume.go
+++ b/weed/storage/volume.go
@@ -333,5 +333,6 @@ func (v *Volume) IsReadOnly() bool {
return v.noWriteOrDelete || v.noWriteCanDelete || v.location.isDiskSpaceLow
}
func (v *Volume) IsEmpty() bool {
- return v.ContentSize() == 0
+ size, _, _ := v.DataBackend.GetStat()
+ return size <= 8 && v.ContentSize() == 0
}