Browse Source

nil check

pull/7445/head
chrislu 4 weeks ago
parent
commit
4237c08a04
  1. 3
      weed/shell/command_ec_rebuild.go

3
weed/shell/command_ec_rebuild.go

@ -177,6 +177,9 @@ func (erb *ecRebuilder) rebuildOneEcVolume(collection string, volumeId needle.Vo
// TODO: fix this logic so it supports concurrent executions
rebuilder := erb.ecNodeWithMoreFreeSlots()
if rebuilder == nil {
return fmt.Errorf("no EC nodes available for rebuild")
}
if rebuilder.freeEcSlot < erasure_coding.TotalShardsCount {
return fmt.Errorf("disk space is not enough")
}

Loading…
Cancel
Save