cuddly-jelly-27016
05/30/2025, 2:59 AMexpires_at. This dictates when the artifact is no longer valid.
2. The composite primary key for artifacts was broadened to include created_at such that there can be multiple rows with the same artifact key (ideally with one and only one non-expired entry if insertions are done carefully and atomically).
3. The compose primary kettle for tag was breaded to include artifact_id such that multiple tags can exist with the same artifact key but can only point to one artifact.
#### Data Layer
1. The data layer was updated to filter expired artifacts in get/list operations, this propagates to tags as well.
2. The data layer was updated such that non-expired artifacts are searched before creating new ones.
#### Manager Layer
1. The TTL is used with a pluggable clock to generated the expires_at value for records.
#### Propeller
Updated propeller to plumb the cache TTL from the task metadata to Flyte data catalog API calls.
#### Future Updates
At a high level I'd like to follow up on this work with a background job of some sort that queries the DB for expired cache entries and then thoroughly cleans them up by deleting the contents if possible and then later removing the rows from Postgres. Similar to what is done in #4655
I realize flytekit changes will need to follow up here as well but I think those will be relatively trivial and this change is entirely backwards compatible.
## How was this patch tested?
Unit tests, for now.
### Labels
Please add one or more of the following labels to categorize your PR:
• added: For new features.
• changed: For changes in existing functionality.
• deprecated: For soon-to-be-removed features.
• removed: For features being removed.
• fixed: For any bug fixed.
• security: In case of vulnerabilities
This is important to improve the readability of release notes.
### Setup process
### Screenshots
## Check all the applicable boxes
• I updated the documentation accordingly.
• All new and existing tests passed.
• All commits are signed-off.
## Related PRs
## Docs link
https://bito.ai#summarystart|
### Summary by Bito
This pull request enhances the Flyte data catalog by introducing support for cache TTL, allowing artifacts to expire and preventing stale entries that could lead to runtime errors. Key modifications include the addition of an 'expires_at' column in the artifacts table and updates to the data layer for filtering expired artifacts. The implementation is designed to be backward compatible and includes unit tests to validate the new functionality.
flyteorg/flyteacoustic-carpenter-78188
05/30/2025, 2:59 AM