fix: do not crash rebalance code instead set the object layer (#17465)

fixes #17421
This commit is contained in:
Harshavardhana
2023-06-20 09:28:23 -07:00
committed by GitHub
parent b6b68be052
commit 65c31fab12
2 changed files with 32 additions and 24 deletions

View File

@@ -141,6 +141,10 @@ func newErasureServerPools(ctx context.Context, endpointServerPools EndpointServ
}
z.decommissionCancelers = make([]context.CancelFunc, len(z.serverPools))
// initialize the object layer.
setObjectLayer(z)
r := rand.New(rand.NewSource(time.Now().UnixNano()))
for {
err := z.Init(ctx) // Initializes all pools.
@@ -159,6 +163,7 @@ func newErasureServerPools(ctx context.Context, endpointServerPools EndpointServ
globalLocalDrivesMu.Lock()
globalLocalDrives = localDrives
defer globalLocalDrivesMu.Unlock()
return z, nil
}