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

rsc: Add updated_at to blob #1570

Merged
merged 1 commit into from
May 20, 2024
Merged

rsc: Add updated_at to blob #1570

merged 1 commit into from
May 20, 2024

Conversation

V-FEXrt
Copy link
Contributor

@V-FEXrt V-FEXrt commented May 17, 2024

Adds an update_at column to Blob to track when updated. Blob eviction TTL now uses updated_at instead of created_at

@V-FEXrt V-FEXrt requested review from colinschmidt and ag-eitilt May 17, 2024 20:34
@@ -492,6 +492,7 @@ mod tests {
let active_key = entity::blob::ActiveModel {
id: NotSet,
created_at: Set((Utc::now() - Duration::days(5)).naive_utc()),
updated_at: Set((Utc::now() - Duration::days(5)).naive_utc()),
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you also need to update the ttl_eviction test later in this file, since it is only setting created_at right now. I'm a little surprised that test still passed so maybe I'm missing something or we might not be running the tests I think we are.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We might not be running the tests I think we are.

This one :) The TTL eviction test is for job eviction. Blob eviction is a separate system with no eviction "policy". For blobs we just delete any unreferenced blob where updated_at older than X. The only way for a blob to become unreferenced is for a job pointing at it to be evicted

Copy link
Contributor

@colinschmidt colinschmidt left a comment

Choose a reason for hiding this comment

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

LGTM

@V-FEXrt V-FEXrt merged commit 2dd29e9 into master May 20, 2024
12 checks passed
@V-FEXrt V-FEXrt deleted the rsc-blob-add-updated-at branch May 20, 2024 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants