Skip to content

Commit

Permalink
Update LEP: Failed-Backups-Cleanup
Browse files Browse the repository at this point in the history
Add failed backup TTL to enable and disbale the auto-deletion.

Signed-off-by: James Lu <james.lu@suse.com>
  • Loading branch information
mantissahz authored and innobead committed Aug 24, 2022
1 parent 8759703 commit b243e93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion chart/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ The available volume spec options are:
description: "In minutes. This setting determines how long Longhorn will keep the backup resource that was failed. Set to 0 to disable the auto-deletion.
Failed backups will be checked and cleaned up during backupstore polling which is controlled by **Backupstore Poll Interval** setting.
Hence this value determines the minimal wait interval of the cleanup. And the actual cleanup interval is multiple of **Backupstore Poll Interval**.
Disabling **Backupstore Poll Interval** also means to disable failed backup auto-deletion."
Disabling **Backupstore Poll Interval** also means to disable failed backup auto-deletion."
group: "Longhorn Default Settings"
type: int
min: 0
Expand Down
12 changes: 6 additions & 6 deletions enhancements/20220801-failed-backups-cleanup.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ Longhorn will leave the failed backups behind and will not delete the backups au

### Goals

- Automatic deletion of failed backups when detected.
- Support the auto-deletion of failed backups that exceeded the TTL.
- Support the global auto-deletion option of failed backups cleanup for users.
- The process should not be stuck in the reconciliation of the controllers.

### Non-goals [optional]

- Clean up unknown files or directories on the remote backup target.
- Support the auto-deletion of failed backups that exceeded the TTL.

## Proposal

Expand Down Expand Up @@ -66,15 +65,15 @@ After the enhancement, Longhorn can delete the failed backups automatically afte
- Users can check the event log to understand why the backup failed and deleted.

- Via `kubectl`
- Users can list the failed backups if auto-deletion is disabled by `kubectl -n longhorn-system get backups`.
- Users can list the failed backups by `kubectl -n longhorn-system get backups` if auto-deletion is disabled.

## Design

### Implementation Overview

**Settings**

- Add setting `failed-backup-auto-deletion`. Default value is `true`.
- Add setting `failed-backup-ttl`. Default value is `1440` minutes and set to `0` to disable the auto-deletion.

**Failed Backup**

Expand All @@ -88,6 +87,7 @@ After the enhancement, Longhorn can delete the failed backups automatically afte

**Backup Volume controller**

- Reconcile loop usually is triggered after backupstore polling which is controlled by **Backupstore Poll Interval** setting.
- Start to get all backups in each reconcile loop
- Tell failed backups from all backups and try to delete failed backups by default.
- Update the backup volume CR status.
Expand All @@ -96,8 +96,8 @@ After the enhancement, Longhorn can delete the failed backups automatically afte

**Integration tests**

- `backups` CRs with `Error` or `Unknown` state will be removed soon by `backup_volume_controller` by default when the `backup_monitor` detects the backup failed.
- `backups` CRs with `Error` or `Unknown` state will not be handled if `failed-backup-auto-deletion` is disabled.
- `backups` CRs with `Error` or `Unknown` state will be removed by `backup_volume_controller` triggered by backupstore polling when the `backup_monitor` detects the backup failed.
- `backups` CRs with `Error` or `Unknown` state will not be handled if the auto-deletion is disabled.

## Note [optional]

Expand Down

0 comments on commit b243e93

Please sign in to comment.