Allow rebalance start when it's stopped/completed (#20009)

This commit is contained in:
Krishnan Parthasarathi
2024-06-27 17:22:30 -07:00
committed by GitHub
parent 722118386d
commit 154fcaeb56
2 changed files with 10 additions and 2 deletions

View File

@@ -350,8 +350,15 @@ func (z *erasureServerPools) IsRebalanceStarted() bool {
z.rebalMu.RLock()
defer z.rebalMu.RUnlock()
if r := z.rebalMeta; r != nil {
if r.StoppedAt.IsZero() {
r := z.rebalMeta
if r == nil {
return false
}
if !r.StoppedAt.IsZero() {
return false
}
for _, ps := range r.PoolStats {
if ps.Participating && ps.Info.Status != rebalCompleted {
return true
}
}