Repository navigation
feat: Enrich task metadata with concrete tabular type - #1383
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe PR splits “tabular” into explicit Table and View entity types across schema and code, adds entity_name columns and indexes, updates task enums/mappings, revises payloads to drop tabular_type, introduces EntityId methods, and adapts APIs, queries, scheduling, workers, and tests to the new variants. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant Catalog as Catalog (tables/views)
participant Queue as TaskQueue
participant DB as Postgres
participant Worker as Expiration/Purge Worker
Client->>Catalog: Request drop table/view
Catalog->>Queue: queue_task(EntityId::{Table|View}, payload without tabular_type)
Queue->>DB: INSERT task (entity_type ∈ {'table','view'}, entity_name, entity_id)
Note over DB: New enum and indexes applied
Worker->>DB: PICK task by queue_name and entity_type {'table','view'}
DB-->>Worker: TaskMetadata(EntityId, entity_type)
Worker->>Worker: entity_id.entity_type() / entity_id.as_uuid()
alt entity_type == table
Worker->>Catalog: Purge/expire table
else entity_type == view
Worker->>Catalog: Purge/expire view
end
Worker->>DB: UPDATE task_log (entity_type, entity_name)
sequenceDiagram
autonumber
actor Client
participant API as Management API
participant DB as Postgres
Client->>API: ListTasksRequest::builder().build()
API->>DB: SELECT ... WHERE entity_type IN ('table','view')
DB-->>API: Rows (entity_type, entity_id, entity_name)
API-->>Client: Tasks with TaskEntity::{Table|View}
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (7)
crates/lakekeeper/src/implementations/postgres/tasks/resolve_tasks.rs (1)
191-193: Add a View-entity coverage test in this module.All tests queue Table entities. Add one that queues a View entity and verifies resolve_tasks returns TaskEntity::View with correct ids and queue.
I can draft a minimal test similar to test_resolve_tasks_active_tasks_only that uses EntityId::View and asserts TaskEntity::View is returned. Do you want me to provide the patch?
Also applies to: 273-279, 369-372, 454-456, 514-516, 585-586, 635-636, 700-701
crates/lakekeeper/src/implementations/postgres/tasks/get_task_details.rs (2)
291-293: Add a View case to unit parsing tests.create_test_row hardcodes EntityType::Table. Add a test constructing a row with EntityType::View and assert TaskEntity::View mapping.
Here’s a focused test you can append in this module’s tests:
#[test] fn test_parse_task_details_view_entity() { let task_id = TaskId::from(Uuid::now_v7()); let warehouse_id = WarehouseId::from(Uuid::now_v7()); let entity_id = Uuid::now_v7(); let scheduled_for = chrono::Utc::now(); let task_created_at = chrono::Utc::now(); let mut row = create_test_row( "view-queue", entity_id, 1, None, Some(TaskOutcome::Success), scheduled_for, Some(scheduled_for), task_created_at, Some(task_created_at), ); row.entity_type = EntityType::View; let result = super::parse_task_details(task_id, warehouse_id, vec![row]) .unwrap() .unwrap(); match result.task.entity { TaskEntity::View { view_id, warehouse_id: wh } => { assert_eq!(*view_id, entity_id); assert_eq!(wh, warehouse_id); } _ => panic!("Expected TaskEntity::View"), } }
605-610: Unify id assertion style for readability.Assertions mix TableId::from(entity_id.as_uuid()) and raw uuid equality. Prefer consistent TableId assertions across tests.
Also applies to: 695-696, 751-752, 833-834, 901-902, 962-963, 1019-1019
crates/lakekeeper/src/catalog/views/drop.rs (1)
245-266: Assert the expected queue for the created task.The test variable is named expiration_tasks, but purge may be scheduled depending on profile/purge_requested. Assert queue_name is either purge or expiration to avoid false positives.
Apply this patch inside the test after retrieving tasks:
- let expiration_tasks = ManagementApiServer::list_tasks( + let tasks = ManagementApiServer::list_tasks( whi, ListTasksRequest::builder() .entities(Some(vec![TaskEntity::View { view_id: loaded_view.metadata.uuid().into(), warehouse_id: whi, }])) .build(), api_context, random_request_metadata(), ) .await .unwrap(); - assert_eq!(expiration_tasks.tasks.len(), 1); - let task = &expiration_tasks.tasks[0]; + assert_eq!(tasks.tasks.len(), 1); + let task = &tasks.tasks[0]; assert_eq!(task.entity, entity); + // Optional: verify queue matches one of the tabular queues + use crate::service::task_queue::{tabular_expiration_queue, tabular_purge_queue}; + let q = task.queue_name.as_str(); + assert!(q == tabular_expiration_queue::QUEUE_NAME.as_str() || q == tabular_purge_queue::QUEUE_NAME.as_str());crates/lakekeeper/src/service/task_queue/mod.rs (3)
197-203: Name collision risk with Postgres-layer EntityType.Two EntityType enums exist (service vs postgres). Consider a more explicit name (e.g., TaskEntityType) to avoid confusion when importing across modules.
923-948: Add a serde round-trip test for the View variant.Mirror the existing table serde test to cover views.
Apply this addition next to the existing test:
#[test] fn test_task_entity_serde_view() { let json = serde_json::json!({ "type": "view", "view-id": "550e8400-e29b-41d4-a716-446655440010", "warehouse-id": "550e8400-e29b-41d4-a716-446655440011" }); let deserialized: super::TaskEntity = serde_json::from_value(json.clone()).unwrap(); assert_eq!( deserialized, super::TaskEntity::View { view_id: super::ViewId::from( uuid::Uuid::parse_str("550e8400-e29b-41d4-a716-446655440010").unwrap() ), warehouse_id: super::WarehouseId::from( uuid::Uuid::parse_str("550e8400-e29b-41d4-a716-446655440011").unwrap() ), } ); let serialized = serde_json::to_value(deserialized).unwrap(); assert_eq!(serialized, json); }
239-246: Optional: Implement Serialize/Deserialize for EntityId if needed later.If TaskMetadata needs to be serialized (logging, APIs), deriving serde on EntityId will save boilerplate.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (17)
crates/lakekeeper/migrations/20250919101934_add_task_entity_name.sql(1 hunks)crates/lakekeeper/src/api/management/v1/tasks.rs(1 hunks)crates/lakekeeper/src/catalog/namespace.rs(3 hunks)crates/lakekeeper/src/catalog/tables.rs(3 hunks)crates/lakekeeper/src/catalog/views/drop.rs(6 hunks)crates/lakekeeper/src/implementations/postgres/namespace.rs(1 hunks)crates/lakekeeper/src/implementations/postgres/tabular/mod.rs(2 hunks)crates/lakekeeper/src/implementations/postgres/tabular/table/mod.rs(1 hunks)crates/lakekeeper/src/implementations/postgres/tabular/view/mod.rs(1 hunks)crates/lakekeeper/src/implementations/postgres/tasks.rs(34 hunks)crates/lakekeeper/src/implementations/postgres/tasks/get_task_details.rs(10 hunks)crates/lakekeeper/src/implementations/postgres/tasks/list_tasks.rs(24 hunks)crates/lakekeeper/src/implementations/postgres/tasks/resolve_tasks.rs(19 hunks)crates/lakekeeper/src/service/task_queue/mod.rs(2 hunks)crates/lakekeeper/src/service/task_queue/tabular_expiration_queue.rs(9 hunks)crates/lakekeeper/src/service/task_queue/tabular_purge_queue.rs(3 hunks)crates/lakekeeper/src/tests/tasks.rs(1 hunks)
🧰 Additional context used
🧠 Learnings (9)
📚 Learning: 2025-08-31T12:39:49.486Z
Learnt from: c-thiel
PR: lakekeeper/lakekeeper#1316
File: .sqlx/query-98ca1801d4e1cf55ce25e7da1de6d4a49d6b32d58bbe53a9ba6ff5284ced6460.json:3-3
Timestamp: 2025-08-31T12:39:49.486Z
Learning: The unique constraint on task(warehouse_id, entity_type, entity_id, queue_name) exists as 'task_warehouse_entity_queue_unique' and was created in migration 20250523101407_tasks_store_their_state.sql, supporting ON CONFLICT operations on these columns.
Applied to files:
crates/lakekeeper/src/implementations/postgres/tabular/mod.rscrates/lakekeeper/src/implementations/postgres/namespace.rscrates/lakekeeper/src/implementations/postgres/tasks.rscrates/lakekeeper/migrations/20250919101934_add_task_entity_name.sqlcrates/lakekeeper/src/implementations/postgres/tasks/resolve_tasks.rscrates/lakekeeper/src/implementations/postgres/tasks/get_task_details.rscrates/lakekeeper/src/implementations/postgres/tasks/list_tasks.rs
📚 Learning: 2025-09-21T21:41:31.186Z
Learnt from: c-thiel
PR: lakekeeper/lakekeeper#1353
File: crates/lakekeeper/src/implementations/postgres/warehouse.rs:446-448
Timestamp: 2025-09-21T21:41:31.186Z
Learning: The task table in the PostgreSQL schema only contains unfinished tasks with task_intermediate_status enum (running, scheduled, should-stop). Completed tasks are moved to the task_log table with task_final_status enum (failed, cancelled, success). This separation means queries on the task table inherently only deal with unfinished tasks.
Applied to files:
crates/lakekeeper/src/implementations/postgres/tabular/mod.rscrates/lakekeeper/src/implementations/postgres/namespace.rs
📚 Learning: 2025-08-31T12:39:49.486Z
Learnt from: c-thiel
PR: lakekeeper/lakekeeper#1316
File: .sqlx/query-98ca1801d4e1cf55ce25e7da1de6d4a49d6b32d58bbe53a9ba6ff5284ced6460.json:3-3
Timestamp: 2025-08-31T12:39:49.486Z
Learning: The unique index on task(warehouse_id, entity_type, entity_id, queue_name) exists as 'task_warehouse_id_entity_type_entity_id_queue_name_idx' and was created in migration 20250523101407_tasks_store_their_state.sql, supporting ON CONFLICT operations on these columns.
Applied to files:
crates/lakekeeper/src/implementations/postgres/tabular/mod.rscrates/lakekeeper/src/implementations/postgres/namespace.rscrates/lakekeeper/migrations/20250919101934_add_task_entity_name.sql
📚 Learning: 2025-09-21T21:44:18.972Z
Learnt from: c-thiel
PR: lakekeeper/lakekeeper#1353
File: .sqlx/query-d7dd04f6a1cd6cfc7d6105516f8dc4230ebc3d20fb42bc4ef718745eb7d4059e.json:3-3
Timestamp: 2025-09-21T21:44:18.972Z
Learning: In Lakekeeper's database schema, the task table only contains active/unfinished tasks with intermediate statuses (running, scheduled, should-stop) using the task_intermediate_status enum. Terminal/completed tasks are stored in the task_log table with final statuses (failed, cancelled, success) using the task_final_status enum. Tasks are moved from task to task_log when they complete, so the task table never contains completed work.
Applied to files:
crates/lakekeeper/src/implementations/postgres/namespace.rs
📚 Learning: 2025-09-25T06:54:15.168Z
Learnt from: c-thiel
PR: lakekeeper/lakekeeper#1378
File: crates/lakekeeper/src/api/management/v1/warehouse/undrop.rs:51-53
Timestamp: 2025-09-25T06:54:15.168Z
Learning: In the lakekeeper codebase, when iterating over &[TabularId] and pattern matching TabularId::View(id), the id variable has type &ViewId. Using *id correctly dereferences to get ViewId, which can be passed directly to authorization methods that expect ViewId parameters.
Applied to files:
crates/lakekeeper/src/implementations/postgres/tasks.rscrates/lakekeeper/src/service/task_queue/mod.rscrates/lakekeeper/src/tests/tasks.rscrates/lakekeeper/src/implementations/postgres/tasks/resolve_tasks.rscrates/lakekeeper/src/service/task_queue/tabular_expiration_queue.rscrates/lakekeeper/src/implementations/postgres/tasks/get_task_details.rscrates/lakekeeper/src/implementations/postgres/tasks/list_tasks.rscrates/lakekeeper/src/implementations/postgres/tabular/view/mod.rscrates/lakekeeper/src/catalog/views/drop.rs
📚 Learning: 2025-09-21T09:54:54.868Z
Learnt from: c-thiel
PR: lakekeeper/lakekeeper#1348
File: .sqlx/query-1c1a32de33e3f54464a1107f7d4d4b8cbd99dd69aae1c740561c3cbbea2eaa19.json:9-10
Timestamp: 2025-09-21T09:54:54.868Z
Learning: In the lakekeeper codebase, ServerId newtype uses manual conversion between uuid::Uuid and ServerId at query call sites rather than sqlx transparent annotations like #[sqlx(transparent)]. The manual conversion approach is the preferred pattern in this codebase.
Applied to files:
crates/lakekeeper/src/tests/tasks.rs
📚 Learning: 2025-09-21T15:13:20.532Z
Learnt from: c-thiel
PR: lakekeeper/lakekeeper#1353
File: crates/lakekeeper/src/implementations/postgres/tasks/get_task_details.rs:163-165
Timestamp: 2025-09-21T15:13:20.532Z
Learning: The entity_name column in the task and task_log tables is NOT NULL as enforced by the migration 20250919101934_add_task_entity_name.sql, which backfills existing rows and sets the constraint, so no NULL checking is needed in queries.
Applied to files:
crates/lakekeeper/migrations/20250919101934_add_task_entity_name.sql
📚 Learning: 2025-08-31T11:28:55.756Z
Learnt from: c-thiel
PR: lakekeeper/lakekeeper#1316
File: .sqlx/query-0aeb5d6e3f65746cefe75e374c69780174a7474580da84345cb777e2343d0280.json:4-22
Timestamp: 2025-08-31T11:28:55.756Z
Learning: The task_final_status PostgreSQL enum and the primary key constraint on task_log(task_id, attempt) were both established in migration 20250523101407_tasks_store_their_state.sql, not missing from the schema.
Applied to files:
crates/lakekeeper/migrations/20250919101934_add_task_entity_name.sql
📚 Learning: 2025-08-31T11:28:55.756Z
Learnt from: c-thiel
PR: lakekeeper/lakekeeper#1316
File: .sqlx/query-0aeb5d6e3f65746cefe75e374c69780174a7474580da84345cb777e2343d0280.json:4-22
Timestamp: 2025-08-31T11:28:55.756Z
Learning: The task_final_status PostgreSQL enum was defined in a previous migration, not missing from the schema as initially flagged.
Applied to files:
crates/lakekeeper/migrations/20250919101934_add_task_entity_name.sql
🧬 Code graph analysis (10)
crates/lakekeeper/src/implementations/postgres/tasks.rs (1)
crates/lakekeeper/src/service/task_queue/mod.rs (3)
task(493-493)task(505-505)as_uuid(231-236)
crates/lakekeeper/src/service/task_queue/mod.rs (2)
crates/lakekeeper/src/service/mod.rs (11)
as_uuid(479-481)from(95-97)from(113-115)from(211-213)from(325-327)from(389-391)from(395-397)from(415-417)from(436-438)from(493-495)from(520-522)crates/lakekeeper/src/service/secrets.rs (1)
as_uuid(44-46)
crates/lakekeeper/src/service/task_queue/tabular_purge_queue.rs (2)
crates/lakekeeper/src/service/task_queue/mod.rs (3)
entity_type(221-226)task(493-493)task(505-505)crates/lakekeeper/src/implementations/postgres/tasks.rs (1)
task_metadata(1652-1660)
crates/lakekeeper/src/catalog/tables.rs (2)
crates/lakekeeper/src/implementations/postgres/tabular/mod.rs (5)
from(728-733)from(737-742)from(1009-1014)from(1018-1023)from(1027-1032)crates/lakekeeper/src/service/task_queue/mod.rs (4)
from(48-50)from(134-136)from(140-142)from(240-245)
crates/lakekeeper/src/catalog/namespace.rs (1)
crates/lakekeeper/src/service/task_queue/mod.rs (4)
from(48-50)from(134-136)from(140-142)from(240-245)
crates/lakekeeper/src/implementations/postgres/tasks/resolve_tasks.rs (2)
crates/lakekeeper/src/service/task_queue/mod.rs (5)
as_uuid(231-236)from(48-50)from(134-136)from(140-142)from(240-245)crates/lakekeeper/src/implementations/postgres/tasks.rs (1)
from(37-42)
crates/lakekeeper/src/service/task_queue/tabular_expiration_queue.rs (5)
crates/lakekeeper/src/service/task_queue/mod.rs (9)
new(61-63)Self(496-496)Self(508-508)task(493-493)task(505-505)warehouse_id(97-103)entity_type(221-226)task_id(306-308)task_id(368-370)crates/lakekeeper/src/service/task_queue/tabular_purge_queue.rs (3)
new(33-37)task(105-105)task(113-113)crates/lakekeeper/src/implementations/postgres/tasks.rs (1)
task_metadata(1652-1660)crates/lakekeeper/src/service/catalog.rs (1)
begin_write(78-78)crates/lakekeeper/src/implementations/postgres/mod.rs (1)
begin_write(69-77)
crates/lakekeeper/src/implementations/postgres/tasks/get_task_details.rs (1)
crates/lakekeeper/src/service/task_queue/mod.rs (2)
warehouse_id(97-103)as_uuid(231-236)
crates/lakekeeper/src/implementations/postgres/tasks/list_tasks.rs (2)
crates/lakekeeper/src/service/task_queue/mod.rs (2)
warehouse_id(97-103)as_uuid(231-236)crates/lakekeeper/src/service/mod.rs (1)
as_uuid(479-481)
crates/lakekeeper/src/catalog/views/drop.rs (4)
crates/lakekeeper/src/implementations/postgres/tasks/list_tasks.rs (2)
tasks(263-266)list_tasks(99-283)crates/lakekeeper/src/implementations/postgres/tasks/resolve_tasks.rs (1)
tasks(85-102)crates/lakekeeper/src/service/task_queue/mod.rs (4)
tasks(428-445)warehouse_id(97-103)task(493-493)task(505-505)crates/lakekeeper/src/api/management/v1/tasks.rs (1)
list_tasks(269-325)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: docker / docker
- GitHub Check: docker / docker
- GitHub Check: docker / docker
- GitHub Check: docker / docker
- GitHub Check: test
- GitHub Check: sqlx-check
🔇 Additional comments (57)
crates/lakekeeper/src/implementations/postgres/tasks.rs (7)
31-34: LGTM! Clean enum update from Tabular to Table/View variants.The EntityType enum update cleanly replaces the single Tabular variant with separate Table and View variants while maintaining kebab-case naming for database compatibility.
36-43: LGTM! Conversion implementation correctly maps EntityId to EntityType.The conversion correctly maps EntityId::Table to EntityType::Table and EntityId::View to EntityType::View, properly aligning with the new entity model.
77-78: LGTM! Correct usage of as_uuid() method.The change from push(entity_id.to_uuid()) to push(entity_id.as_uuid()) correctly uses the new UUID accessor method introduced in the EntityId type.
168-171: LGTM! Proper entity reconstruction from database results.The entity ID reconstruction correctly maps EntityType variants back to their corresponding EntityId variants (View → EntityId::View, Table → EntityId::Table).
298-301: LGTM! Consistent entity type mapping in task picking.The entity ID reconstruction in pick_task follows the same correct pattern, maintaining consistency across the codebase.
1038-1038: LGTM! Test helper correctly uses new EntityId construction pattern.The test helper function correctly updates entity name formatting to use as_uuid() instead of the removed to_uuid() method.
1058-1058: LGTM! Test entity construction properly uses new Table variant.All test entity constructions correctly use EntityId::Table(Uuid::now_v7().into()) pattern, properly converting UUID to TableId via into().
Also applies to: 1089-1089, 1139-1139
crates/lakekeeper/src/implementations/postgres/namespace.rs (3)
365-365: LGTM! Query correctly filters for both table and view entity types.The change from
t.entity_type = 'tabular'tot.entity_type in ('table', 'view')correctly broadens the filter to include both table and view entities for expiration tasks, aligning with the new entity type model.
771-771: LGTM! Consistent entity type filtering in undrop operation.The locked_tasks CTE correctly filters for both 'table' and 'view' entity types when identifying expiration tasks, maintaining consistency with the new entity model.
496-499: LGTM! Proper mapping of TabularType to TabularId variants.The conversion from database TabularType to TabularId correctly creates TabularId::Table or TabularId::View based on the type, maintaining type safety.
crates/lakekeeper/src/tests/tasks.rs (1)
135-135: LGTM! Test correctly uses new EntityId construction pattern.The test properly constructs EntityId::Table using Uuid::now_v7().into() to convert UUID to TableId, following the new entity model.
crates/lakekeeper/src/implementations/postgres/tabular/mod.rs (2)
474-474: LGTM! Query correctly filters for both table and view types in expiration tasks.The LEFT JOIN condition properly filters entity types to include both 'table' and 'view' when joining with expiration tasks.
771-771: LGTM! Clear tabular deleted_at correctly handles both entity types.The locked_tasks CTE in clear_tabular_deleted_at properly filters for both 'table' and 'view' entity types when identifying related expiration tasks.
crates/lakekeeper/src/implementations/postgres/tabular/table/mod.rs (1)
2073-2081: LGTM! Task scheduling correctly uses Table entity variant.The TabularExpirationTask scheduling properly constructs the metadata with EntityId::Table and the payload no longer includes the removed tabular_type field, correctly implementing the simplified entity model.
crates/lakekeeper/src/implementations/postgres/tabular/view/mod.rs (2)
877-877: LGTM! Correct migration to EntityId::View.The change from
EntityId::Tabular(created_meta.uuid().into())toEntityId::View(created_meta.uuid().into())is correct and aligns with the broader refactoring to split tabular entities into explicit Table and View types.
883-885: Simplified payload matches new API.The removal of
tabular_typefromTabularExpirationPayloadcorrectly aligns with the payload simplification changes across the codebase.crates/lakekeeper/src/service/task_queue/tabular_purge_queue.rs (3)
11-11: Clean import simplification.The import change from
{Result, TabularType}to justResultcorrectly removes the now-obsoleteTabularTypeimport.
33-37: Simplified constructor matches the removal of tabular_type.The
TabularPurgePayload::new()constructor correctly accepts onlytabular_location, dropping the unnecessarytabular_typeparameter.
83-83: Entity type derivation correctly uses new EntityId API.The span now correctly derives the entity type from
task.task_metadata.entity_id.entity_type()instead of the removedtabular_typefield.crates/lakekeeper/src/catalog/namespace.rs (4)
19-19: Import correctly reflects new API surface.The import correctly removes
TabularTypewhile retainingTabularDeleteProfile, aligning with the removal of TabularType throughout the codebase.
31-31: Public export cleanup is appropriate.The removal of
TabularIdfrom the public exports is correct as it's being replaced by the newEntityIdsystem in the task queue module.
497-497: Correct use of EntityId::from() for TabularId conversion.Using
EntityId::from(tabular_id)leverages theFrom<TabularId>implementation to automatically convert TabularId to the appropriate EntityId variant (Table or View).
502-502: TabularPurgePayload correctly simplified.The removal of
tabular_typefrom the payload aligns with the simplified constructor that only needs the location.crates/lakekeeper/src/catalog/tables.rs (5)
45-45: Import correctly excludes removed TabularType.The import change properly removes
TabularTypewhile keepingTabularDeleteProfileandDeleteKind.
783-783: EntityId conversion maintains type safety.Using
EntityId::from(table_id)wheretable_idis aTableIdwill correctly produceEntityId::Table(table_id)through theFromimplementation.
788-790: Payload simplification is consistent.The
TabularPurgePayloadcorrectly contains onlytabular_location, matching the simplified constructor.
809-809: EntityId conversion for expiration task is correct.The change from a hypothetical
EntityId::Tabular(table_id)toEntityId::from(table_id)maintains the same behavior while using the proper conversion mechanism.
815-821: TabularExpirationPayload correctly simplified.The removal of
tabular_typefrom the payload is consistent with the new API where entity type is derived from the EntityId itself.crates/lakekeeper/src/service/task_queue/tabular_expiration_queue.rs (13)
10-10: Clean import update.The removal of
TabularTypefrom imports is correct as it's no longer needed in the expiration queue implementation.
16-16: Transaction is already imported from service module.The
Transactiontrait is correctly imported from theservicemodule for use in transaction operations.
43-45: Simplified constructor aligns with payload changes.The
new()method correctly accepts onlydeletion_kind, removing the obsoletetabular_typeparameter.
88-95: Entity identification correctly uses new EntityId system.The code properly extracts the entity ID and derives the entity type for logging, replacing the old tabular-specific approach.
101-101: Function call correctly passes required parameters.The
instrumented_expirefunction call correctly passes the catalog state, authorizer, and task.
112-113: Entity extraction is consistent.The entity_id extraction and function call properly use the new EntityId system.
115-123: Logging messages properly use entity_id.The logging messages correctly reference
entity_idinstead of the old tabular-specific identifiers.
140-140: Entity ID extraction for transaction handling.The entity_id is properly extracted from task metadata for use in the transaction logic.
147-217: Pattern matching correctly handles Table and View variants.The match statement properly handles both
EntityId::TableandEntityId::Viewvariants, calling the appropriate drop functions and authorizer methods for each type. This is a clean separation of concerns between tables and views.
229-229: TabularPurgePayload correctly uses simplified constructor.The
TabularPurgePayload::new(tabular_location)call correctly uses the simplified constructor that only requires the location.
264-264: Test import cleanup.The test imports correctly include
DeleteKindfrom the management API.
342-342: Test correctly uses EntityId::Table.The test properly constructs
EntityId::Table(table.table_id)for the task metadata.
347-349: Test payload correctly uses simplified structure.The test correctly creates
TabularExpirationPayloadwith only thedeletion_kindfield.crates/lakekeeper/src/implementations/postgres/tasks/resolve_tasks.rs (2)
90-98: EntityType → TaskEntity mapping looks correct.Table/View branches map to the right TaskEntity variants and ids.
65-66: EntityType mapping is correct: enum derives sqlx::Type withtype_name = "entity_type"andrename_all = "kebab-case".crates/lakekeeper/src/api/management/v1/tasks.rs (5)
184-220: Builder on ListTasksRequest: good addition.typed_builder defaults on all fields make the API ergonomic without breaking existing deserialization.
443-481: Entity auth/control split by Table/View is sound.Partitioning to table/view with specific actions (incl. Undrop for expiration tasks) is clear and correct.
526-616: Per-entity auth for list filter looks correct.Checks warehouse match and authorizes table/view actions appropriately.
1-20: typed-builder dependency present: declared in crates/lakekeeper/Cargo.toml.
269-325: Page size is normalized and clamped before use
list_taskscallsCONFIG.page_size_or_pagination_default(page_size)to apply the default and clamp topagination_size_max, then uses that value in allLIMITclauses.crates/lakekeeper/src/implementations/postgres/tasks/get_task_details.rs (1)
92-100: EntityType → TaskEntity mapping is correct.Table/View constructed with the right ids; warehouse_id is enforced by the query’s WHERE clause.
crates/lakekeeper/src/catalog/views/drop.rs (1)
78-85: Switched to EntityId::View in scheduling: correct.Payloads align with the updated task model.
Also applies to: 107-115
crates/lakekeeper/src/service/task_queue/mod.rs (1)
197-203: New EntityType/EntityId API: solid and cohesive.
- Clear Table/View split.
- as_uuid() and entity_type() helpers are handy.
- From keeps interop simple.
Also applies to: 204-217, 219-227, 229-237, 239-246
crates/lakekeeper/src/implementations/postgres/tasks/list_tasks.rs (5)
48-56: LGTM! Entity type mapping now correctly distinguishes tables and views.The updated pattern matching properly maps
EntityType::TableandEntityType::Viewto their respectiveTaskEntityvariants, aligning with the new enum structure introduced in the migration.
146-151: LGTM! Entity filtering correctly handles the new enum variants.The filter logic now properly handles both
TableandViewentities by collecting entity IDs alongside their types, ensuring the SQL query can accurately filter by bothentity_idandentity_type.
399-436: LGTM! Test correctly validates entity ID handling with the newTablevariant.The test properly creates an
EntityId::TableusingUuid::now_v7().into()and correctly validates the entity usingas_uuid()method, which aligns with the new UUID accessor patterns mentioned in the AI summary.
563-564: Test uses correct accessor method.The test correctly uses
entity_id1.as_uuid().into()when constructing theTaskEntity::Table, aligning with the new UUID accessor pattern.
1344-1345: Test properly uses the new UUID accessor pattern.The test correctly uses
entity_id1.as_uuid().into()when constructing the entity filter, maintaining consistency with the new API.crates/lakekeeper/migrations/20250919101934_add_task_entity_name.sql (1)
49-61: Consider adding indexes for query performance.The new indexes on
(warehouse_id, entity_type, entity_id, created_at DESC)and(warehouse_id, entity_type, entity_id, task_created_at DESC)are well-structured for the list_tasks query patterns. The DESC ordering on timestamps aligns with the ORDER BY clause in the queries.
✅ PR Title Formatted CorrectlyThe title of this PR match the correct format. Thank you! |
* feat: Publish images to Dockerhub (lakekeeper#1274) * feat: Update UI to 0.9.0 with multi-project support (lakekeeper#1275) * chore: release 0.9.4 Release-As: 0.9.4 * chore: release main (lakekeeper#1262) * chore(ci): Fix Dockerhub login * chore(docs): Improve developer guide (lakekeeper#1265) * chore(docs): add info regarding `view_version`'s internal representation (lakekeeper#1261) * chore(docs): Architecture clarify Secret Store (lakekeeper#1284) * fix: Update Limes to 0.2.2 - Fixes compilation issue due to breaking `jwks_client_rs` change (lakekeeper#1282) * fix: Update Limes to 0.2.2 * increase min rust version * chore: release 0.9.5 Release-As: 0.9.5 * chore: release main (lakekeeper#1286) * chore: enable changelog sections for release-please (lakekeeper#1264) k * fix(deps): update rust crate rand to v0.9.2 (lakekeeper#1252) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate async-channel to v2.5.0 (lakekeeper#1225) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update dependency mkdocs-material to v9.6.17 (lakekeeper#1289) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate anyhow to v1.0.99 (lakekeeper#1290) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore: Remove bitnami images (lakekeeper#1288) * feat!: Move to Lakekeeper IO based on hyperscaler SDKs (lakekeeper#1285) * chore(deps): update rust crate reqwest to v0.12.23 (lakekeeper#1294) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(docs): Improve Cloud storage test docs * fix: accept "disable" as PG sslmode as documented (lakekeeper#1303) * feat: Simplify task interface, re-exports, enable delete-after-commit (lakekeeper#1302) * feat: Introduce `RequestMetadata` for Internal Principals which bypass AuthZ (lakekeeper#1306) * chore(deps): update azure/setup-helm action to v4.3.1 (lakekeeper#1299) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(test): use nextest filterset instead of needs_env_var (lakekeeper#1304) * chore(deps): update rust crate openssl-src to v300.5.2 (lakekeeper#1292) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate async-compression to v0.4.28 (lakekeeper#1311) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate thiserror to v2.0.16 (lakekeeper#1296) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat: Provide `ApiContext` to externally registered tasks (lakekeeper#1307) * feat!: Simplify Task interface, extend SpecializedTask interface (lakekeeper#1310) * feat: Improve authorizer `are_allowed_*` batch check signature (lakekeeper#1315) * chore(authz): Enforce use of AuthZ decisions with #[must_use] (lakekeeper#1317) * feat: Task Management APIs (lakekeeper#1316) * chore(deps): update rust crate tracing-subscriber to v0.3.20 [security] (lakekeeper#1318) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat: Add `RunNow` and `RunAt` to Controls for Tasks (lakekeeper#1322) * chore(deps): update rust crate tokio-util to v0.7.16 (lakekeeper#1313) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(docs): Improve Entra ID docs (lakekeeper#1325) * chore(docs): Improve Upgrades & Migration docs (lakekeeper#1326) * feat: Add tasks heartbeat with Catalog state (lakekeeper#1324) * ci: add configuration for CodeRabbit reviews (lakekeeper#1327) * feat: Add optional STS session-tags in S3 STS requests for ABAC authorization (lakekeeper#1230) * feat: Random Server IDs (lakekeeper#1328) * chore(deps): update rust crate percent-encoding to v2.3.2 (lakekeeper#1312) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat(authz): Deprecate Permission Endpoints for Tables without WarehouseIDs (lakekeeper#1334) * fix: Tasks endpoints in router (lakekeeper#1335) * feat(ci): add nextest profile ci_no_secrets for external PRs (lakekeeper#1333) * chore(deps): update rust crate chrono to v0.4.42 (lakekeeper#1331) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore: Pin examples duckdb version to 1.3 (lakekeeper#1343) * feat!: Require warehouse_id when checking permissions on views or tables via ID (lakekeeper#1340) * fix: migrate away from bitnami in unittest.yml (lakekeeper#1344) * chore: Remove coderabitt config * fix(docs): Fix inconsistent URL format in README (lakekeeper#1345) Co-authored-by: Christian <[email protected]> * feat: Remove serde_yaml & serde_yml (lakekeeper#1341) * feat!: add `warehouse_id` to PKs of all `table_*` and `view_*` tables (lakekeeper#1254) * feat: Minor namespace join performance improvements * fix: Warehouse permissions are directly used for task retrieval & control (lakekeeper#1347) * fix: Potential Race Condition when undropping Tabulars (lakekeeper#1342) * fix: table rename authz and error handling (lakekeeper#1346) Co-authored-by: Andre Luis Anastacio <[email protected]> * chore(deps): update rust crate google-cloud-auth to v1.1.2 (lakekeeper#1337) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Christian <[email protected]> * chore(deps): update rust crate time to v0.3.44 (lakekeeper#1349) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update dependency mkdocs-material to v9.6.20 (lakekeeper#1309) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Christian <[email protected]> * feat: Set ServerID during migration (lakekeeper#1348) * chore(deps): Remove utoipa fork (lakekeeper#1352) * chore(deps): update rust crate serde_with to v3.14.1 (lakekeeper#1351) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate url to v2.5.7 (lakekeeper#1354) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate async-compression to v0.4.30 (lakekeeper#1323) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Christian <[email protected]> * chore(deps): update rust crate serde_json to v1.0.145 (lakekeeper#1250) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Christian <[email protected]> * chore(deps): update strum monorepo to v0.27.2 (lakekeeper#1251) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Christian <[email protected]> * chore(deps): update serde monorepo to v1.0.226 (lakekeeper#1355) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate clap to v4.5.48 (lakekeeper#1356) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat: Add Entity Names to Tasks (lakekeeper#1353) * fix: case insensitivity of catalog endpoints (lakekeeper#1338) * fix: Improve delete_warehouse error message for active tasks * chore(deps): update rust crate tempfile to v3.22.0 (lakekeeper#1359) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Christian <[email protected]> * chore(deps): update rust crate axum-prometheus to 0.9.0 (lakekeeper#1358) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix: PgSslMode not supported error string * feat(authz)!: add OpenFGA schema v4 and v3->v4 migration (lakekeeper#1314) Co-authored-by: Christian <[email protected]> Co-authored-by: Christian Thiel <[email protected]> * chore(deps): update rust crate uuid to v1.18.1 (lakekeeper#1362) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update dependency markdown-grid-tables to v0.6.0 (lakekeeper#1357) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate anyhow to v1.0.100 (lakekeeper#1350) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix: clippy * chore(deps): update rust crate moka to v0.12.11 (lakekeeper#1365) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate tempfile to v3.23.0 (lakekeeper#1367) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate async-nats to 0.43.0 (lakekeeper#1366) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update actions/setup-node action to v5 (lakekeeper#1371) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update actions/checkout action to v5 (lakekeeper#1369) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update actions/setup-python action to v6 (lakekeeper#1372) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat: V3 support (lakekeeper#1364) * chore: Set Get Task Permission to "CanGetMetadata" (lakekeeper#1376) * chore(deps): update dependency node to v22 (lakekeeper#1373) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat(authz)!: extend OpenFGA tabular entities with WarehouseId (lakekeeper#1329) --------- Co-authored-by: Christian <[email protected]> Co-authored-by: Christian Thiel <[email protected]> * feat: Add support for tasks affecting views (lakekeeper#1378) * feat(authz): Add specific Task Actions (lakekeeper#1379) * chore(tests): Test with Iceberg 1.9.2 & 1.10.0 (lakekeeper#1267) * feat: Enrich task metadata with concrete tabular type (lakekeeper#1383) * feat: Add loadTable Snapshots filter (lakekeeper#1385) * feat: add endpoint for fuzzy search of tabulars (lakekeeper#1387) * feat: Update UI to 0.10.0 (lakekeeper#1390) * feat(ui): Update UI to 0.10.1 * chore: Use lakekeeper re-exports in bin (lakekeeper#1391) * fix(tabular-search): distance and docs for `searchterm is uuid` (lakekeeper#1393) * chore(examples): Idempotent bucket creation in minimal example (lakekeeper#1386) In the case where you already have a bucket created, like the "examples" bucket, I ran into an issue where the createbuckets service fails, and this prevents lakekeeper from starting back up. This fix adds a simple minio flag to ignore buckets that already exist, making things even more user friendly * feat: Make number of workers spawned for Expiration & Purge configurable (lakekeeper#1395) * chore: release main (lakekeeper#1295) * chore: added gif to readme (lakekeeper#1396) * chore: remove unneded `#[allow(dead_code)]` (lakekeeper#1399) * fix: Use FnOnce for queue & service registration * Revert "fix: Use FnOnce for queue & service registration" This reverts commit 47b03a0. * chore(docs): Add 0.10 docs * perf(db): remove `join namespace` from `active_tabulars` view (lakekeeper#1401) * doc(db): how to connect to db and inspect schema (lakekeeper#1402) * feat: implement `OpenFgaEntity` for `ServerId` (lakekeeper#1394) * impl OpenFgaEntity * Use the implementation * fix: Use FnOnce for queue & service registration (lakekeeper#1404) * chore(deps): update dependency mkdocs-material to v9.6.21 (lakekeeper#1406) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat: Expose client-managed X-Iceberg-Access-Delegation (lakekeeper#1407) * fix: Use higher consistency for some OpenFGA queries (lakekeeper#1408) * feat: Improve Kubernetes Auth docs (lakekeeper#1415) * chore: release 0.10.1 Release-As: 0.10.1 * fix: Endpoint stats for Project Endpoints (lakekeeper#1412) * feat: Add create table guard to cleanup location on Failure (lakekeeper#1418) * chore: Generate ID types with Macro (lakekeeper#1419) * chore: Re-Export Tokio from lakekeeper-io create (lakekeeper#1420) * fix: Add support for `write.metadata.metrics.` Table Properties (lakekeeper#1422) * fix: Update UI to 0.10.2 (lakekeeper#1423) * chore: release main (lakekeeper#1403) * fix: Parse empty ProjectID headers as None (lakekeeper#1424) * chore: release 0.10.2 Release-As: 0.10.2 * chore: release main (lakekeeper#1425) * feat: Add `debug_migrate_before_serve` env var (lakekeeper#1426) * feat: Move OpenFGA Authorizer to separate crate (lakekeeper#1421) * chore(renovate): Group dependencies * chore(renovate): ignore additional deps * chore: Rename src/service -> src/server, trait Catalog -> CatalogStore (lakekeeper#1428) * feat(examples): add k8s iceberg sink connector (avro) (lakekeeper#1336) --------- Co-authored-by: Christian <[email protected]> * chore(ci): Fix release please (lakekeeper#1433) * feat: Expose License Information via API (lakekeeper#1432) * fix(deps): update all non-major dependencies (lakekeeper#1429) * chore(ci): Remove mgmt API version update via release-please * chore: Restructure catalog_store into multiple modules (lakekeeper#1434) * feat: Validate Downscoping works on Warehouse creation (lakekeeper#1437) * chore(ci): Fix release please * docs: Add info about installing sqlx to developer-guide.md (lakekeeper#1438) * docs: Update developer-guide.md (lakekeeper#1439) * chore(deps): update all non-major dependencies (lakekeeper#1436) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix: Better normalization for ARNs in S3 Profile (lakekeeper#1441) * chore(deps): update all non-major dependencies (lakekeeper#1442) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(main): release 0.10.3 (lakekeeper#1427) * fix: Release Please CI outputs * fix(ci): Revert 0.10.3 release * chore(main): release 0.10.3 (lakekeeper#1446) * feat: Introduce CatalogWarehouseOps & CatalogNamespaceOps abstractions (lakekeeper#1440) * feat: Allow x-user-agent header (lakekeeper#1453) * feat: Table & View Ops Abstractions, Improved Error Handling (lakekeeper#1454) * fix: CORS allow access delegation & etag headers (lakekeeper#1455) * fix: Headers should be lowercase (lakekeeper#1457) * chore(tests): Add trino information_schema.tables test (lakekeeper#1456) * chore: Introduce open-api feature to gate utoipa and swagger (lakekeeper#1458) * chore: Release As 0.11 * fix: Debug assertion table identifier mismatch for signer (lakekeeper#1460) * feat: Caching Short-Term-Credentials (STC) (lakekeeper#1459) * feat: Warehouse Cache (lakekeeper#1462) * chore(deps): update actions/setup-node action to v6 (lakekeeper#1443) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat: Version based Warehouse Cache (lakekeeper#1465) * feat: AuthZ Server and Project Ops (lakekeeper#1471) * chore(deps): update github artifact actions (lakekeeper#1461) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore: Rename release branch pattern to rel-* * feat: Catalog returns full Namespace Hierarchy for nested Namespaces (lakekeeper#1472) --------- Co-authored-by: Christian <[email protected]> Co-authored-by: Christian Thiel <[email protected]> Co-authored-by: Dao Thanh Tung <[email protected]> Co-authored-by: Moritz Zielke <[email protected]> Co-authored-by: Baptiste Gouhoury <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Dolan Antenucci <[email protected]> Co-authored-by: Anatoly Popov <[email protected]> Co-authored-by: Andre Luis Anastacio <[email protected]> Co-authored-by: Scott Haines <[email protected]> Co-authored-by: Viktor Kessler <[email protected]> Co-authored-by: Yohan Valencia <[email protected]> Co-authored-by: Paul Roman <[email protected]>
Summary by CodeRabbit