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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View File

@ -26,6 +26,7 @@ import (
"github.com/minio/madmin-go" "github.com/minio/madmin-go"
"github.com/minio/minio/internal/color" "github.com/minio/minio/internal/color"
"github.com/minio/minio/internal/config/storageclass"
"github.com/minio/minio/internal/logger" "github.com/minio/minio/internal/logger"
"github.com/minio/pkg/console" "github.com/minio/pkg/console"
"github.com/minio/pkg/wildcard" "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 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 return status, true
} }

2
go.mod
View File

@ -45,7 +45,7 @@ require (
github.com/minio/csvparser v1.0.0 github.com/minio/csvparser v1.0.0
github.com/minio/highwayhash v1.0.2 github.com/minio/highwayhash v1.0.2
github.com/minio/kes v0.14.0 github.com/minio/kes v0.14.0
github.com/minio/madmin-go v1.0.21-0.20210812051916-2b99aca7520a github.com/minio/madmin-go v1.0.21-0.20210820144629-f47e578ef886
github.com/minio/minio-go/v7 v7.0.13-0.20210715203016-9e713532886e github.com/minio/minio-go/v7 v7.0.13-0.20210715203016-9e713532886e
github.com/minio/parquet-go v1.0.0 github.com/minio/parquet-go v1.0.0
github.com/minio/pkg v1.0.11 github.com/minio/pkg v1.0.11

2
go.sum
View File

@ -1025,6 +1025,8 @@ github.com/minio/madmin-go v1.0.12/go.mod h1:BK+z4XRx7Y1v8SFWXsuLNqQqnq5BO/axJ8I
github.com/minio/madmin-go v1.0.17/go.mod h1:4nl9hvLWFnwCjkLfZSsZXEHgDODa2XSG6xGlIZyQ2oA= github.com/minio/madmin-go v1.0.17/go.mod h1:4nl9hvLWFnwCjkLfZSsZXEHgDODa2XSG6xGlIZyQ2oA=
github.com/minio/madmin-go v1.0.21-0.20210812051916-2b99aca7520a h1:Ha8O6nUq/CjlAc2bYRf7PGdJrikYGwjrSGvRStDcfWU= github.com/minio/madmin-go v1.0.21-0.20210812051916-2b99aca7520a h1:Ha8O6nUq/CjlAc2bYRf7PGdJrikYGwjrSGvRStDcfWU=
github.com/minio/madmin-go v1.0.21-0.20210812051916-2b99aca7520a/go.mod h1:4nl9hvLWFnwCjkLfZSsZXEHgDODa2XSG6xGlIZyQ2oA= github.com/minio/madmin-go v1.0.21-0.20210812051916-2b99aca7520a/go.mod h1:4nl9hvLWFnwCjkLfZSsZXEHgDODa2XSG6xGlIZyQ2oA=
github.com/minio/madmin-go v1.0.21-0.20210820144629-f47e578ef886 h1:sZ22LseOBW5OQIih+fi0v+JBDU4RiaqLbEM3t3JF80I=
github.com/minio/madmin-go v1.0.21-0.20210820144629-f47e578ef886/go.mod h1:4nl9hvLWFnwCjkLfZSsZXEHgDODa2XSG6xGlIZyQ2oA=
github.com/minio/mc v0.0.0-20210626002108-cebf3318546f h1:hyFvo5hSFw2K417YvDr/vAKlgCG69uTuhZW/5LNdL0U= github.com/minio/mc v0.0.0-20210626002108-cebf3318546f h1:hyFvo5hSFw2K417YvDr/vAKlgCG69uTuhZW/5LNdL0U=
github.com/minio/mc v0.0.0-20210626002108-cebf3318546f/go.mod h1:tuaonkPjVApCXkbtKENHBtsqUf7YTV33qmFrC+Pgp5g= github.com/minio/mc v0.0.0-20210626002108-cebf3318546f/go.mod h1:tuaonkPjVApCXkbtKENHBtsqUf7YTV33qmFrC+Pgp5g=
github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw= github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw=