fix: simplify background heal and trigger heal items early (#9928)

Bonus fix during versioning merge one of the PR was missing
the offline/online disk count fix from #9801 port it correctly
over to the master branch from release.

Additionally, add versionID support for MRF

Fixes #9910
Fixes #9931
This commit is contained in:
Harshavardhana
2020-06-29 13:07:26 -07:00
committed by GitHub
parent 7cea3f7da4
commit a38ce29137
16 changed files with 156 additions and 137 deletions

View File

@@ -207,6 +207,12 @@ func initSafeMode(ctx context.Context, newObject ObjectLayer) (err error) {
}
}(txnLk)
// Enable healing to heal drives if possible
if globalIsErasure {
initBackgroundHealing(ctx, newObject)
initLocalDisksAutoHeal(ctx, newObject)
}
// **** WARNING ****
// Migrating to encrypted backend should happen before initialization of any
// sub-systems, make sure that we do not move the above codeblock elsewhere.
@@ -422,9 +428,9 @@ func serverMain(ctx *cli.Context) {
setMaxResources()
if globalIsErasure {
// Init global heal state
globalAllHealState = initHealState()
globalBackgroundHealState = initHealState()
// New global heal state
globalAllHealState = newHealState()
globalBackgroundHealState = newHealState()
}
// Configure server.
@@ -504,12 +510,6 @@ func serverMain(ctx *cli.Context) {
newAllSubsystems()
// Enable healing to heal drives if possible
if globalIsErasure {
initBackgroundHealing(GlobalContext, newObject)
initLocalDisksAutoHeal(GlobalContext, newObject)
}
go startBackgroundOps(GlobalContext, newObject)
logger.FatalIf(initSafeMode(GlobalContext, newObject), "Unable to initialize server switching into safe-mode")