From 127e8bf3b6f1e6f30a4a957123261af5ea50c5e6 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Tue, 1 Feb 2022 02:28:20 +0100 Subject: [PATCH] heal: Avoid printing repetitive error to heal a root disk (#14220) The healing code repeatedly tries to heal a root disk when it is empty the reason is that connectEndpoint() returns errUnformattedDisk even if the disk is a root disk. Changing that to returning another error will avoid queueing the disk to the healing code in each connect disks iteration. --- cmd/erasure-sets.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/erasure-sets.go b/cmd/erasure-sets.go index 979fd13b3..30a0afe9b 100644 --- a/cmd/erasure-sets.go +++ b/cmd/erasure-sets.go @@ -146,7 +146,7 @@ func connectEndpoint(endpoint Endpoint) (StorageAPI, *formatErasureV3, error) { if errors.Is(err, errUnformattedDisk) { info, derr := disk.DiskInfo(context.TODO()) if derr != nil && info.RootDisk { - return nil, nil, fmt.Errorf("Disk: %s returned %w", disk, derr) // make sure to '%w' to wrap the error + return nil, nil, fmt.Errorf("Disk: %s is a root disk", disk) } } return nil, nil, fmt.Errorf("Disk: %s returned %w", disk, err) // make sure to '%w' to wrap the error