Repository navigation
feat: install noncurrent lifecycle schema - #1620
Conversation
Coverage Report for CI Build 40898949198Coverage increased (+0.09%) to 86.887%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
d14fe99 to
33a9e87
Compare
|
@claude review always |
There was a problem hiding this comment.
I re-reviewed the latest push and found no new bugs. Both earlier inline points look addressed. This is still a large schema change with SECURITY DEFINER functions and a trigger on the multitenant tenants table, so a human look would still be worthwhile.
What was reviewed:
- OrioleDB wake path: both wake triggers now call reconcile without comparing OLD and NEW images, and policy changes are detected from the generation stored in the state row.
- reconcile_lifecycle_state now treats a continuation as idle only under the same version-1 predicate the bucket-delete guard uses, so continuations it can't read are kept and only woken.
- Grants and revokes on the new SECURITY DEFINER functions (search_path pinned to pg_catalog, PUBLIC revoked, roles resolved from storage.* settings).
Extended reasoning...
The change adds about 2,600 lines: a multitenant migration with a lifecycle_tenants table and an enroll trigger on public.tenants, four tenant migrations (a state table, two concurrent indexes, and the writer-coordination triggers and functions), and large integration test suites. The security-sensitive surface is the new SECURITY DEFINER functions (reconcile_lifecycle_state, wake_lifecycle_state, delete_lifecycle_objects) and their role grants, plus a BEFORE DELETE guard on storage.buckets. The latest commits appear to fix both issues raised earlier in inline comments. I deferred rather than approved because of the size, the privileged functions, and the design choices about locking, recovery and continuation semantics, which deserve a maintainer's judgment.
295fbb1 to
92012a8
Compare
92012a8 to
c5354bd
Compare
Signed-off-by: Ferhat Elmas <elmas.ferhat@gmail.com>
Signed-off-by: Ferhat Elmas <elmas.ferhat@gmail.com>
Signed-off-by: Ferhat Elmas <elmas.ferhat@gmail.com>
Signed-off-by: Ferhat Elmas <elmas.ferhat@gmail.com>
Signed-off-by: Ferhat Elmas <elmas.ferhat@gmail.com>
Signed-off-by: Ferhat Elmas <elmas.ferhat@gmail.com>
8c70599 to
d21aa5d
Compare
|
seems previous commit broke the multigres image, and this is fixing. In the meantime, multigres CI failed |
TylerHillery
left a comment
There was a problem hiding this comment.
Approving with one nit feedback and one question. The question around the service role calling that storage.delete_lifecycle_objects I don't think is a major concern as given service roles already can set storage.allow_query and do what they want but just wanted to make sure that service role callers could theoretically call this function with any archived object id without it be eligible for deletion by a lifecycle rule.
Signed-off-by: Ferhat Elmas <elmas.ferhat@gmail.com>
What kind of change does this PR introduce?
feature
What is the current behavior?
Storage can save lifecycle configurations but it has no lifecycle execution state or worker to expire noncurrent versions.
Deleting a bucket does not need to account for an in-flight lifecycle batch.
What is the new behavior?
Additional context
This provides the schema, not the lifecycle worker.
Expiration of backend objects begins only after the engine and its required versioning integration are in place.
Multipart rules aren't integrated and will come up as a follow up.
Related to #1380