From b94dd835c9cfa44fbc1c28909c192b4af22f1dee Mon Sep 17 00:00:00 2001 From: Anis Eleuch Date: Thu, 6 Jun 2024 15:30:43 +0100 Subject: [PATCH] decom: Fix CurrentSize output when generating the status (#19883) StartSize starts with the raw free space of all disks in the given pool, however during the status, CurrentSize is not showing the current free raw space, as expected at least by `mc admin decom status` since it was written. --- cmd/erasure-server-pool-decom.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cmd/erasure-server-pool-decom.go b/cmd/erasure-server-pool-decom.go index e13c77791..a7d5cc1e7 100644 --- a/cmd/erasure-server-pool-decom.go +++ b/cmd/erasure-server-pool-decom.go @@ -1327,11 +1327,7 @@ func (z *erasureServerPools) Status(ctx context.Context, idx int) (PoolStatus, e poolInfo := z.poolMeta.Pools[idx].Clone() if poolInfo.Decommission != nil { poolInfo.Decommission.TotalSize = pi.Total - if poolInfo.Decommission.Failed || poolInfo.Decommission.Canceled { - poolInfo.Decommission.CurrentSize = pi.Free - } else { - poolInfo.Decommission.CurrentSize = poolInfo.Decommission.StartSize + poolInfo.Decommission.BytesDone - } + poolInfo.Decommission.CurrentSize = pi.Free } else { poolInfo.Decommission = &PoolDecommissionInfo{ TotalSize: pi.Total,