skip disks under scanning when healing disks (#17822)

Bonus:

- avoid calling DiskInfo() calls when missing blocks
  instead heal the object using MRF operation.

- change the max_sleep to 250ms beyond that we will
  not stop healing.
This commit is contained in:
Harshavardhana
2023-08-09 12:51:47 -07:00
committed by GitHub
parent 6e860b6dc5
commit c45bc32d98
6 changed files with 42 additions and 22 deletions

View File

@@ -309,6 +309,7 @@ func (er erasureObjects) getOnlineDisksWithHealing() (newDisks []StorageAPI, hea
}
wg.Wait()
var scanningDisks []StorageAPI
for i, info := range infos {
// Check if one of the drives in the set is being healed.
// this information is used by scanner to skip healing
@@ -317,9 +318,16 @@ func (er erasureObjects) getOnlineDisksWithHealing() (newDisks []StorageAPI, hea
healing = true
continue
}
newDisks = append(newDisks, disks[i])
if !info.Scanning {
newDisks = append(newDisks, disks[i])
} else {
scanningDisks = append(scanningDisks, disks[i])
}
}
// Prefer new disks over disks which are currently being scanned.
newDisks = append(newDisks, scanningDisks...)
return newDisks, healing
}