mirror of
https://github.com/minio/minio.git
synced 2025-11-20 09:56:07 -05:00
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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user