From 6d76db9d6c4a02654f4f77316875e3735a791628 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Fri, 11 Nov 2022 19:40:45 -0800 Subject: [PATCH] improve server startup error when pools are incorrect (#16056) --- cmd/erasure-server-pool.go | 5 +++-- internal/config/storageclass/storage-class.go | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/erasure-server-pool.go b/cmd/erasure-server-pool.go index 41014b9f8..7b785480b 100644 --- a/cmd/erasure-server-pool.go +++ b/cmd/erasure-server-pool.go @@ -31,6 +31,7 @@ import ( "sync" "time" + "github.com/dustin/go-humanize" "github.com/minio/madmin-go" "github.com/minio/minio-go/v7/pkg/set" "github.com/minio/minio-go/v7/pkg/tags" @@ -89,7 +90,7 @@ func newErasureServerPools(ctx context.Context, endpointServerPools EndpointServ } if err = storageclass.ValidateParity(commonParityDrives, ep.DrivesPerSet); err != nil { - return nil, fmt.Errorf("All current serverPools should have same parity ratio - expected %d, got %d", commonParityDrives, ecDrivesNoConfig(ep.DrivesPerSet)) + return nil, fmt.Errorf("parity validation returned an error %w <- (%d, %d), for pool(%s)", err, commonParityDrives, ep.DrivesPerSet, humanize.Ordinal(i+1)) } storageDisks[i], formats[i], err = waitForFormatErasure(local, ep.Endpoints, i+1, @@ -115,7 +116,7 @@ func newErasureServerPools(ctx context.Context, endpointServerPools EndpointServ // Validate if users brought different DeploymentID pools. if deploymentID != formats[i].ID { - return nil, fmt.Errorf("All serverPools should have same deployment ID expected %s, got %s", deploymentID, formats[i].ID) + return nil, fmt.Errorf("all pools must have same deployment ID - expected %s, got %s for pool(%s)", deploymentID, formats[i].ID, humanize.Ordinal(i+1)) } z.serverPools[i], err = newErasureSets(ctx, ep, storageDisks[i], formats[i], commonParityDrives, i) diff --git a/internal/config/storageclass/storage-class.go b/internal/config/storageclass/storage-class.go index b833f7754..ba6d69e43 100644 --- a/internal/config/storageclass/storage-class.go +++ b/internal/config/storageclass/storage-class.go @@ -167,12 +167,12 @@ func ValidateParity(ssParity, setDriveCount int) error { // SS parity disks should be greater than or equal to minParityDisks. // Parity below minParityDisks is not supported. if ssParity > 0 && ssParity < minParityDisks { - return fmt.Errorf("Standard storage class parity %d should be greater than or equal to %d", + return fmt.Errorf("parity %d should be greater than or equal to %d", ssParity, minParityDisks) } if ssParity > setDriveCount/2 { - return fmt.Errorf("Standard storage class parity %d should be less than or equal to %d", ssParity, setDriveCount/2) + return fmt.Errorf("parity %d should be less than or equal to %d", ssParity, setDriveCount/2) } return nil