Skip to content

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.

avoid divided by 0

Chris Lu9bcaa6557426
diff --git a/weed/storage/volume_vacuum.go b/weed/storage/volume_vacuum.go
index 230fca104f..c0bdcdf965 100644
--- a/weed/storage/volume_vacuum.go
+++ b/weed/storage/volume_vacuum.go
@@ -10,6 +10,9 @@ import (
)
func (v *Volume) garbageLevel() float64 {
+ if v.ContentSize() == 0 {
+ return 0
+ }
return float64(v.nm.DeletedSize()) / float64(v.ContentSize())
}