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

[rel-v0.24] Implement Configurable Retention Period for Delta Snapshots #640 #669

Merged

Conversation

seshachalam-yv
Copy link
Contributor

What this PR does / why we need it:
Cherry-pick of #640

This PR resolves the request for a configurable retention period for delta snapshots. This feature aims to provide users with more flexibility in preserving delta snapshots for both GC policies (Exponential and Limit-Based)

Changes introduced in this PR include:

  • Added a new delta-snapshot-retention-period parameter in the SnapshotterConfig to allow for the customization of the retention period for delta snapshots. This new setting can be adjusted via command-line flags.
  • Modified the GarbageCollectDeltaSnapshots function, formerly garbageCollectDeltaSnapshots, to utilize the DeltaSnapshotRetentionPeriod parameter when identifying delta snapshots for deletion. This change ensures that delta snapshots within the user-specified retention period will not be deleted.
  • Added documentation on the garbage collection mechanism (doc/usage/garbage_collection.md) to include a detailed explanation of the new delta-snapshot-retention-period setting.
  • Exported function GarbageCollectDeltaSnapshots to add unit tests.
  • Removed dead code from snapshotter_test.go

Which issue(s) this PR fixes:

Special notes for your reviewer:

Release note:

Introduced `delta-snapshot-retention-period` CLI flag to extend the configurable retention period for delta snapshots in `etcd-backup-restore`, enhancing flexibility for backup retention.

…#640)

* `feat: Implement configurable retention period for delta snapshots`

This commit introduces a new parameter, `delta-snapshot-retention-period`, in the `SnapshotterConfig`, allowing users to customize the retention period for delta snapshots.

The garbage collection function `GarbageCollectDeltaSnapshots` is modified to use this new setting, ensuring delta snapshots within the user-specified period are not deleted.

* Fixed lint error

* Fixed failing unit test

* Refactor and improve unit tests for GarbageCollectDeltaSnapshots

* Addressed PR feedback

- Improved grammar and phrasing for better readability.
- Fixed doc string for 'GarbageCollectDeltaSnapshots' function.

* Update snapshotter_test.go with additional safety checks

Co-authored-by: Aaron Francis Fernandes <[email protected]>

Update snapshotter_test.go with additional safety checks

* Apply suggestions from code review

Co-authored-by: Shreyas Rao <[email protected]>

* Addressed review feedback

---------

Co-authored-by: Shreyas Rao <[email protected]>
@seshachalam-yv seshachalam-yv requested a review from a team as a code owner October 11, 2023 13:02
@gardener-robot gardener-robot added the needs/review Needs review label Oct 11, 2023
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 11, 2023
@gardener-robot gardener-robot added size/xl Size of pull request is huge (see gardener-robot robot/bots/size.py) needs/second-opinion Needs second review by someone else labels Oct 11, 2023
@gardener-robot-ci-1 gardener-robot-ci-1 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Oct 11, 2023
Copy link
Collaborator

@shreyas-s-rao shreyas-s-rao left a comment

Choose a reason for hiding this comment

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

/lgtm

@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging and removed needs/review Needs review needs/second-opinion Needs second review by someone else labels Oct 11, 2023
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 11, 2023
@seshachalam-yv seshachalam-yv merged commit 1806000 into gardener:rel-v0.24 Oct 12, 2023
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Oct 12, 2023
@seshachalam-yv seshachalam-yv deleted the cherry-pick-pr-640 branch October 12, 2023 04:17
@shreyas-s-rao shreyas-s-rao changed the title Implement Configurable Retention Period for Delta Snapshots #640 [rel-0.24] Implement Configurable Retention Period for Delta Snapshots #640 Nov 10, 2023
@shreyas-s-rao shreyas-s-rao changed the title [rel-0.24] Implement Configurable Retention Period for Delta Snapshots #640 [rel-v0.24] Implement Configurable Retention Period for Delta Snapshots #640 Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) reviewed/lgtm Has approval for merging reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) size/xl Size of pull request is huge (see gardener-robot robot/bots/size.py) status/closed Issue is closed (either delivered or triaged)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants