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>
This commit is contained in:
Konstantin Lebedev
2023-06-13 10:22:46 +05:00
committed by GitHub
parent a25bca0692
commit 4527ead295
4 changed files with 9 additions and 5 deletions

View File

@@ -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
}