-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat: Add TTL support to OpenSaves #458
Conversation
@@ -668,15 +718,6 @@ func (s *openSavesServer) UploadChunk(stream pb.OpenSaves_UploadChunkServer) err | |||
return stream.SendAndClose(chunk.ToProto()) | |||
} | |||
|
|||
// deleteObjectOnExit deletes the object from GS if there are errors uploading the data or inserting a chunkref | |||
func (s *openSavesServer) deleteObjectOnExit(ctx context.Context, path string) error { |
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.
Following the pattern in this file, I've moved this helper function on top of the public function that is using it.
@@ -623,6 +637,12 @@ func (m *MetaDB) PromoteBlobRefWithRecordUpdater(ctx context.Context, blob *blob | |||
} | |||
} | |||
|
|||
// Call the custom defined updater method as well to modify the record. | |||
record, err := updater(record) |
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.
I need to update the record previously to update the Blob, this is because the record could have its ExpiresAt updated, and thus we need to update the Blob's too.
Missing UT for the new Collector. |
/gcbrun |
…timestamp or state
@vasconcelosvcd @lorangf I've fixed the failing test though, please, wait until I add the missing UT for the Async Collector to run /gcbrun again. EDIT: I've added the missing test. |
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.
… in Async Collector
/gcbrun |
/gcbrun |
/gcbrun |
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.
Looks good.
We should be create a new release and bump up the minor version at a minimum since there were some changes in the interface but nothing that is not backward compatible.
Add TTL support for both Records and Blobs via the new field ExpiresAt.
What type of PR is this?
What this PR does / Why we need it:
This PR adds a new ExpiresAt field to Records and Blobs.
Also handles that the new ExpiresAt value is inherited by Blobs when these are attached to Records.
Finally, to prevent needing to add ExpiresAt to Chunks, it changes the behavior of the chunk update to delete the previously existing chunk.
Which issue(s) this PR fixes:
Closes #457
Special notes for your reviewer: