aboutsummaryrefslogtreecommitdiff
path: root/weed/topology/disk.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2024-10-24 22:42:38 -0700
committerchrislu <chris.lu@gmail.com>2024-10-24 22:42:38 -0700
commit6e388e29c9251ffd4559f5e3d441a96cd556f79a (patch)
tree64f9a35b808356232eec36a1e7d8d9e8cd060389 /weed/topology/disk.go
parent8d6189bcc514b48b792deca65d4dd8efc3e0c3f9 (diff)
downloadseaweedfs-6e388e29c9251ffd4559f5e3d441a96cd556f79a.tar.xz
seaweedfs-6e388e29c9251ffd4559f5e3d441a96cd556f79a.zip
correcting free volume count, factor it during ec encoding to ensure enough disk space available
fix https://github.com/seaweedfs/seaweedfs/issues/6163
Diffstat (limited to 'weed/topology/disk.go')
-rw-r--r--weed/topology/disk.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/topology/disk.go b/weed/topology/disk.go
index 6d789e34b..80a4aaa2d 100644
--- a/weed/topology/disk.go
+++ b/weed/topology/disk.go
@@ -66,7 +66,7 @@ func (d *DiskUsages) ToDiskInfo() map[string]*master_pb.DiskInfo {
m := &master_pb.DiskInfo{
VolumeCount: diskUsageCounts.volumeCount,
MaxVolumeCount: diskUsageCounts.maxVolumeCount,
- FreeVolumeCount: diskUsageCounts.maxVolumeCount - diskUsageCounts.volumeCount,
+ FreeVolumeCount: diskUsageCounts.maxVolumeCount - (diskUsageCounts.volumeCount - diskUsageCounts.remoteVolumeCount) - (diskUsageCounts.ecShardCount+1)/erasure_coding.DataShardsCount,
ActiveVolumeCount: diskUsageCounts.activeVolumeCount,
RemoteVolumeCount: diskUsageCounts.remoteVolumeCount,
}
@@ -250,7 +250,7 @@ func (d *Disk) ToDiskInfo() *master_pb.DiskInfo {
Type: string(d.Id()),
VolumeCount: diskUsage.volumeCount,
MaxVolumeCount: diskUsage.maxVolumeCount,
- FreeVolumeCount: diskUsage.maxVolumeCount - diskUsage.volumeCount,
+ FreeVolumeCount: diskUsage.maxVolumeCount - (diskUsage.volumeCount - diskUsage.remoteVolumeCount) - (diskUsage.ecShardCount+1)/erasure_coding.DataShardsCount,
ActiveVolumeCount: diskUsage.activeVolumeCount,
RemoteVolumeCount: diskUsage.remoteVolumeCount,
}