Skip to content

Commit

Permalink
Reduce auto balancing logging noise for detachted volumes
Browse files Browse the repository at this point in the history
  • Loading branch information
dihmandrake authored Feb 11, 2025
1 parent be22faf commit 8f3780e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion controller/volume_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2966,7 +2966,9 @@ func (c *VolumeController) getNodeCandidatesForAutoBalanceZone(v *longhorn.Volum
}

if v.Status.Robustness != longhorn.VolumeRobustnessHealthy {
log.Warnf("Failed to auto-balance volume in %s state", v.Status.Robustness)
if v.Status.State != longhorn.VolumeStateDetached { // Detached volumes are not "healthy". Hence, it would cause excessive logging periodically for detached volumes
log.Warnf("Failed to auto-balance volume in %s robustness and %s state", v.Status.Robustness, v.Status.State)
}
return candidateNames
}

Expand Down

0 comments on commit 8f3780e

Please sign in to comment.