From 21aaa4c1f1c85486b5148605f8cb15db3f870be2 Mon Sep 17 00:00:00 2001 From: chrislu Date: Tue, 8 Feb 2022 01:51:13 -0800 Subject: [PATCH] ec.encode: calculate free ec slots based on (maxVolumeCount-volumeCount) fix https://github.com/chrislusf/seaweedfs/issues/2642 --- weed/shell/command_ec_common.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/shell/command_ec_common.go b/weed/shell/command_ec_common.go index 3ca310b5d..b3bd0ce5d 100644 --- a/weed/shell/command_ec_common.go +++ b/weed/shell/command_ec_common.go @@ -172,7 +172,7 @@ func countFreeShardSlots(dn *master_pb.DataNodeInfo, diskType types.DiskType) (c if diskInfo == nil { return 0 } - return int(diskInfo.MaxVolumeCount-diskInfo.ActiveVolumeCount)*erasure_coding.DataShardsCount - countShards(diskInfo.EcShardInfos) + return int(diskInfo.MaxVolumeCount-diskInfo.VolumeCount)*erasure_coding.DataShardsCount - countShards(diskInfo.EcShardInfos) } type RackId string