From 901d1314afcee3af4ce8c8eb495b40fe8106bef3 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Mon, 23 Aug 2021 20:53:54 +0100 Subject: [PATCH] Fix formatting disks in a test environment (#13043) markRootDisksAsDown() relies on disk info even if the disk is unformatted. Therefore, we should always return DiskInfo data even when DiskInfo storage API returns errUnformattedDisk --- buildscripts/verify-healing.sh | 6 ++---- cmd/storage-rest-client.go | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/buildscripts/verify-healing.sh b/buildscripts/verify-healing.sh index 4ff842349..77e14bd83 100755 --- a/buildscripts/verify-healing.sh +++ b/buildscripts/verify-healing.sh @@ -86,16 +86,14 @@ function __init__() } function perform_test() { - start_minio_3_node 120 + start_minio_3_node 60 echo "Testing Distributed Erasure setup healing of drives" echo "Remove the contents of the disks belonging to '${1}' erasure set" - set -x - rm -rf ${WORK_DIR}/${1}/*/ - start_minio_3_node 200 + start_minio_3_node 60 rv=$(check_online) if [ "$rv" == "1" ]; then diff --git a/cmd/storage-rest-client.go b/cmd/storage-rest-client.go index ffad56e66..dfe57899e 100644 --- a/cmd/storage-rest-client.go +++ b/cmd/storage-rest-client.go @@ -298,10 +298,9 @@ func (client *storageRESTClient) DiskInfo(ctx context.Context) (info DiskInfo, e client.diskInfoCache.Update = client.diskInfo }) val, err := client.diskInfoCache.Get() - if err == nil { - info = val.(DiskInfo) + if val != nil { + return val.(DiskInfo), err } - return info, err }