From 6add64613074ec22ec7e706c1ff47db1e3e24fd0 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 4 Dec 2018 10:25:56 -0800 Subject: [PATCH] Fix logging of initialization errors in distributed mode (#6914) --- cmd/prepare-storage.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/prepare-storage.go b/cmd/prepare-storage.go index d07dd11d0..7e8935806 100644 --- a/cmd/prepare-storage.go +++ b/cmd/prepare-storage.go @@ -128,6 +128,15 @@ func connectLoadInitFormats(retryCount int, firstDisk bool, endpoints EndpointLi } defer closeStorageDisks(storageDisks) + // Attempt to load all `format.json` from all disks. + formatConfigs, sErrs := loadFormatXLAll(storageDisks) + // Check if we have + for i, sErr := range sErrs { + if _, ok := formatCriticalErrors[sErr]; ok { + return nil, fmt.Errorf("Disk %s: %s", endpoints[i], sErr) + } + } + // Connect to all storage disks, a connection failure will be // only logged after some retries. for _, disk := range storageDisks { @@ -139,15 +148,6 @@ func connectLoadInitFormats(retryCount int, firstDisk bool, endpoints EndpointLi } } - // Attempt to load all `format.json` from all disks. - formatConfigs, sErrs := loadFormatXLAll(storageDisks) - // Check if we have - for i, sErr := range sErrs { - if _, ok := formatCriticalErrors[sErr]; ok { - return nil, fmt.Errorf("Disk %s: %s", endpoints[i], sErr) - } - } - // Pre-emptively check if one of the formatted disks // is invalid. This function returns success for the // most part unless one of the formats is not consistent