heal: Return parity for storage classes in heal info API (#13038)

`mc admin heal` command will show servers/disks tolerance, for that
purpose, you need to know the number of parity disks for each storage
class.

Parity is always the same in all pools.
This commit is contained in:
Anis Elleuch
2021-08-23 16:50:35 +01:00
committed by GitHub
parent 63f3e5c3fc
commit 7fb9301c03
3 changed files with 9 additions and 1 deletions

View File

@@ -26,6 +26,7 @@ import (
"github.com/minio/madmin-go"
"github.com/minio/minio/internal/color"
"github.com/minio/minio/internal/config/storageclass"
"github.com/minio/minio/internal/logger"
"github.com/minio/pkg/console"
"github.com/minio/pkg/wildcard"
@@ -133,6 +134,11 @@ func getBackgroundHealStatus(ctx context.Context, o ObjectLayer) (madmin.BgHealS
return status.Sets[i].ID < status.Sets[j].ID
})
backendInfo := o.BackendInfo()
status.SCParity = make(map[string]int)
status.SCParity[storageclass.STANDARD] = backendInfo.StandardSCParity
status.SCParity[storageclass.RRS] = backendInfo.RRSCParity
return status, true
}