Browse Source

fix max volume count auto setting

related to https://github.com/seaweedfs/seaweedfs/issues/6041#issuecomment-2360448182
dependabot/maven/other/java/client/com.google.protobuf-protobuf-java-3.25.5
chrislu 3 months ago
parent
commit
4ec6eab004
  1. 3
      weed/storage/store.go

3
weed/storage/store.go

@ -620,7 +620,8 @@ func (s *Store) MaybeAdjustVolumeMax() (hasChanges bool) {
unusedSpace := diskLocation.UnUsedSpace(volumeSizeLimit) unusedSpace := diskLocation.UnUsedSpace(volumeSizeLimit)
unclaimedSpaces := int64(diskStatus.Free) - int64(unusedSpace) unclaimedSpaces := int64(diskStatus.Free) - int64(unusedSpace)
volCount := diskLocation.VolumesLen() volCount := diskLocation.VolumesLen()
maxVolumeCount := int32(volCount)
ecShardCount := diskLocation.EcShardCount()
maxVolumeCount := int32(volCount) + int32((ecShardCount+erasure_coding.DataShardsCount)/erasure_coding.DataShardsCount)
if unclaimedSpaces > int64(volumeSizeLimit) { if unclaimedSpaces > int64(volumeSizeLimit) {
maxVolumeCount += int32(uint64(unclaimedSpaces)/volumeSizeLimit) - 1 maxVolumeCount += int32(uint64(unclaimedSpaces)/volumeSizeLimit) - 1
} }

Loading…
Cancel
Save