From 7fb9301c03440268b8f7f172ac802bf424c3e3d9 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Mon, 23 Aug 2021 16:50:35 +0100 Subject: [PATCH] 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. --- cmd/global-heal.go | 6 ++++++ go.mod | 2 +- go.sum | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/global-heal.go b/cmd/global-heal.go index 54211f845..6fef4d6f3 100644 --- a/cmd/global-heal.go +++ b/cmd/global-heal.go @@ -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 } diff --git a/go.mod b/go.mod index 3e5864802..7f6e41ffa 100644 --- a/go.mod +++ b/go.mod @@ -45,7 +45,7 @@ require ( github.com/minio/csvparser v1.0.0 github.com/minio/highwayhash v1.0.2 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/parquet-go v1.0.0 github.com/minio/pkg v1.0.11 diff --git a/go.sum b/go.sum index 4940713ca..a1f71e426 100644 --- a/go.sum +++ b/go.sum @@ -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.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.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/go.mod h1:tuaonkPjVApCXkbtKENHBtsqUf7YTV33qmFrC+Pgp5g= github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw=