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
s3api: cap SOSAPI capacity by the reported physical disk bytes (#12118)
Chris Lud182be6a9e60
diff --git a/weed/s3api/s3api_sosapi.go b/weed/s3api/s3api_sosapi.goindex f1c635e7ae..67d1eac813 100644--- a/weed/s3api/s3api_sosapi.go+++ b/weed/s3api/s3api_sosapi.go@@ -216,14 +216,23 @@ func collectBucketUsageFromTopology(t *master_pb.TopologyInfo, collectionName st}// calculateClusterCapacity sums up the total and available capacity of the entire cluster.+// Slot counts are an admission bound, not a capacity measurement — -max can+// be set higher than the volumes a disk actually fills — so a disk that+// reports physical counters is capped by them.func calculateClusterCapacity(t *master_pb.TopologyInfo, volumeSizeLimitMb uint64) (total, available int64) {volumeSize := int64(volumeSizeLimitMb) * 1024 * 1024for _, dc := range t.DataCenterInfos {for _, r := range dc.RackInfos {for _, dn := range r.DataNodeInfos {for _, disk := range dn.DiskInfos {- total += int64(disk.MaxVolumeCount) * volumeSize- available += int64(disk.FreeVolumeCount) * volumeSize+ slotTotal := int64(disk.MaxVolumeCount) * volumeSize+ slotFree := int64(disk.FreeVolumeCount) * volumeSize+ if disk.DiskTotalBytes > 0 {+ slotTotal = min(slotTotal, int64(disk.DiskTotalBytes))+ slotFree = min(slotFree, int64(disk.DiskFreeBytes))+ }+ total += slotTotal+ available += slotFree}}}