Skip to content
Merged
Changes from 1 commit
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
8 changes: 7 additions & 1 deletion pkg/controller/perconaservermongodb/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,16 @@ func (r *ReconcilePerconaServerMongoDB) deleteOldBackupTasks(ctx context.Context
return true
}

if len(oldjobs) > 0 {
log.Info("cleaning up old backups based on retention count",
"job", item.Name, "keep", ret.Count, "toDelete", len(oldjobs))
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nmarukovich please check these comments

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeap valid point

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have this log when, at the same time we are iterating oldjobs and we generate one log for each old job we have?


for _, todel := range oldjobs {
log.Info("deleting outdated backup", "job", item.Name, "backup", todel.Name)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would't say that these old jobs are outdated, they are not. They are just exceeding retention. Maybe we can say exceeding retention

@gkech gkech Jun 5, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: deleting backup exceeding retention

err = r.client.Delete(ctx, &todel)
if err != nil {
log.Error(err, "failed to delete backup object")
log.Error(err, "failed to delete backup object", "backup", todel.Name)
Comment on lines 167 to +171
return true
Comment on lines +168 to 172
Comment on lines +168 to 172
Comment on lines +168 to 172
}
}
Expand Down
Loading