From b68f0cbde456798b95ddbf9e6b5173fe64bcd409 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 24 Jan 2022 19:40:02 -0800 Subject: [PATCH] ignore remote disks with diskID empty as offline (#14168) concurrent loading of erasure sets can now expose a situation in a distributed setup that might return diskID as empty, treat such disks as offline. --- cmd/erasure-sets.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/erasure-sets.go b/cmd/erasure-sets.go index 19004634a..979fd13b3 100644 --- a/cmd/erasure-sets.go +++ b/cmd/erasure-sets.go @@ -160,6 +160,9 @@ func connectEndpoint(endpoint Endpoint) (StorageAPI, *formatErasureV3, error) { // - i'th position is the set index // - j'th position is the disk index in the current set func findDiskIndexByDiskID(refFormat *formatErasureV3, diskID string) (int, int, error) { + if diskID == "" { + return -1, -1, errDiskNotFound + } if diskID == offlineDiskUUID { return -1, -1, fmt.Errorf("diskID: %s is offline", diskID) } @@ -439,6 +442,9 @@ func newErasureSets(ctx context.Context, endpoints PoolEndpoints, storageDisks [ } return } + if diskID == "" { + return + } m, n, err := findDiskIndexByDiskID(format, diskID) if err != nil { logger.LogIf(ctx, err) @@ -1337,6 +1343,7 @@ func (s *erasureSets) HealFormat(ctx context.Context, dryRun bool) (res madmin.H m, n, err := findDiskIndexByDiskID(refFormat, format.Erasure.This) if err != nil { + logger.LogIf(ctx, err) continue }