Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE-1246]: increased retry count, improved logging #1251

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/crcontrollers/drive/drivecontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (c *Controller) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
switch status {
case update:
if err := c.client.UpdateCR(ctx, drive); err != nil {
log.Errorf("Failed to update Drive %s CR", driveName)
log.Errorf("Failed to update Drive %s CR, error: %s", driveName, err.Error())
return ctrl.Result{}, client.IgnoreNotFound(err)
}
case remove:
Expand Down
3 changes: 2 additions & 1 deletion pkg/node/volumemgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const (
// Discover function replaces drive health with passed value if the annotation is set
driveHealthOverrideAnnotation = "health"

numberOfRetries = 2
numberOfRetries = 5
delayBeforeRetry = 2
)

Expand Down Expand Up @@ -400,6 +400,7 @@ func (m *VolumeManager) retryDriveUpdate(ctx context.Context, volume *volumecrd.
m.addVolumeStatusAnnotation(drive, volume.Name, apiV1.VolumeUsageReleased)
}
if err := m.k8sClient.UpdateCR(ctx, drive); err != nil {
ll.Infof("Volume %s annotation on drive %s failed, error: %s", volume.Name, drive.Name, err.Error())
ll.Infof("Retrying to update drive %s usage status to %s. Retry number: %d. Sleep %d seconds and retry ...",
drive.Name, drive.Spec.Usage, i, delayBeforeRetry)
time.Sleep(time.Second * delayBeforeRetry)
Expand Down
Loading