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
factor in existing ec volume count when estimating max volume count
chrislu050efe6c0846
diff --git a/weed/storage/disk_location_ec.go b/weed/storage/disk_location_ec.goindex 6d681d2c27..4050a7930e 100644--- a/weed/storage/disk_location_ec.go+++ b/weed/storage/disk_location_ec.go@@ -218,9 +218,13 @@ func (l *DiskLocation) unmountEcVolumeByCollection(collectionName string) map[nereturn deltaVols}-func (l *DiskLocation) EcVolumesLen() int {+func (l *DiskLocation) EcShardCount() int {l.ecVolumesLock.RLock()defer l.ecVolumesLock.RUnlock()- return len(l.ecVolumes)+ shardCount := 0+ for _, ecVolume := range l.ecVolumes {+ shardCount += len(ecVolume.Shards)+ }+ return shardCount}diff --git a/weed/storage/store.go b/weed/storage/store.goindex 6b4467abcf..d290909f15 100644--- a/weed/storage/store.go+++ b/weed/storage/store.go@@ -149,7 +149,7 @@ func (s *Store) FindFreeLocation(diskType DiskType) (ret *DiskLocation) {}currentFreeCount := location.MaxVolumeCount - int32(location.VolumesLen())currentFreeCount *= erasure_coding.DataShardsCount- currentFreeCount -= int32(location.EcVolumesLen())+ currentFreeCount -= int32(location.EcShardCount())currentFreeCount /= erasure_coding.DataShardsCountif currentFreeCount > max {max = currentFreeCount