diff options
| author | chrislu <chris.lu@gmail.com> | 2024-01-11 08:19:09 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2024-01-11 08:19:09 -0800 |
| commit | 050efe6c0846ea94bec0de2709b922da62b80d12 (patch) | |
| tree | 003e15aa669950e2ebf140e7bbb4bc66f4898b99 /weed/storage/disk_location_ec.go | |
| parent | a7fc723ae0992c787629ad57c6f2c4f05c1de553 (diff) | |
| download | seaweedfs-050efe6c0846ea94bec0de2709b922da62b80d12.tar.xz seaweedfs-050efe6c0846ea94bec0de2709b922da62b80d12.zip | |
factor in existing ec volume count when estimating max volume count
related to https://github.com/seaweedfs/seaweedfs/issues/5191
Diffstat (limited to 'weed/storage/disk_location_ec.go')
| -rw-r--r-- | weed/storage/disk_location_ec.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/weed/storage/disk_location_ec.go b/weed/storage/disk_location_ec.go index 6d681d2c2..4050a7930 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[ne return 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 } |
