-
Notifications
You must be signed in to change notification settings - Fork 100
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
Add Bucket Lock
immutable object support for Google Cloud Storage.
#776
Conversation
- Added `RetentionExpiry` field to Snapshot struct to store retention expiry time. - Added `IsDeletable` method to `Snapshot` struct to determine if a snapshot is deletable based on `RetentionExpiry`. - Introduced `ExcludeSnapshotMetadataKey` constant for marking snapshots to be ignored. - Modified garbage collection logic to skip immutable snapshots. - Updated GCS snapstore list function to exclude objects with `x-etcd-snapshot-exclude` metadata.
…a `bool` argument.
…e tagged snapshots' behavior.
bceba62
to
a592264
Compare
* This rename makes the distinction clearer between retention expiry which is used for delta snapshots typically, and the immutability expiry time of a snapshot.
@ishan16696 @seshachalam-yv I've added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @renormalize for making changes and adding a doc. I have added few nits:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good to me, just couple of nits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
LGTM
@renormalize can you please update the release notes as requested here: #776 (comment)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @renormalize for PR and addressing the review comments.
LGMT!!
What this PR does / why we need it:
Enables etcd-backup-restore to handle immutable objects as provided by bucket lock in Google Cloud Storage.
A new method
IsDeletable()
is added to theSnapshot
struct
. This method returns abool
which informs the caller whether theSnapshot
instance can be deleted from the object store. It internally checks the immutability expiration time of the object and returnstrue
if it has expired.Custom metadata can be added to objects in Google Cloud Storage. In case any particular object (snapshot) is to be excluded during restoration, custom metadata can be added to that object with the key
x-etcd-snapshot-exclude
and valuetrue
.The
List()
method ofSnapStore
interface is now enhanced. It takes abool
.false
:List()
will only return the objects in the object store that do not have the custom metadatax-etcd-snapshot-exclude
added to it.true
:List()
will return all objects present in the object store. This variant is used in garbage collection.Which issue(s) this PR fixes:
Fixes # #777 only for GCS
Special notes for your reviewer:
This PR only adds support for GCS. Identical PRs adding support for other providers will be raised separately.
Release note: