Skip to content

Commit

Permalink
fix(log): reduce auto balancing logging noise for detached volumes
Browse files Browse the repository at this point in the history
See: longhorn/longhorn#10302
Signed-off-by: Jasper Bernhardt <jasper.bernhardt@gmail.com>
(cherry picked from commit 5f9ec86)
  • Loading branch information
dihmandrake authored and mergify[bot] committed Feb 14, 2025
1 parent c13db73 commit c9d945b
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 c9d945b

Please sign in to comment.