Fix expire not running when target PVC is deleted before backup expires#276
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes MantleBackup expiration handling so backups can still be deleted (or scheduled for deletion) even when the backup’s target PVC disappears before the backup reaches its expiry time.
Changes:
- Update
expireto return a boolean indicating whether reconciliation should stop after requesting deletion. - Invoke
expireearlier inreconcileLocalBackupandreconcileAsSecondary, before attempting to resolve the snapshot target (PVC/PV). - Remove the later
expirecalls that could be skipped whengetSnapshotTargetfails.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
05b0bd9 to
96e4490
Compare
43ea3fc to
cc1c6ed
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
internal/controller/mantlebackup_controller.go:521
- This early expiration path has the same cleanup gap for secondary backups: if the target PVC is gone, finalization gets
targetPVCNotFound=trueand skipsremoveRBDSnapshot, so the MantleBackup can be removed while the imported RBD snapshot remains. Please make the deletion path clean up the snapshot using persisted manifest/status data instead of relying on the live PVC lookup.
if stopProcessing, err := r.expire(ctx, backup); stopProcessing || err != nil {
return requeueReconciliation(), err
}
529af43 to
04d7c92
Compare
molpako
requested changes
Jun 10, 2026
Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
molpako
requested changes
Jun 11, 2026
Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
molpako
approved these changes
Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.