Repository navigation
feat: Simplify task interface, re-exports - #1302
Conversation
WalkthroughAdds cancellation-token–based shutdown and centralized background service orchestration; refactors task queues to typed, cancellable SpecializedTask model; renames TabularDetails.ident → table_id and propagates mapping changes; enhances error models and responses; replaces rand with fastrand; adds jittered exponential backoff; updates docs and tests. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Operator
participant Serve as lakekeeper::serve
participant JoinSet as Background JoinSet
participant Router as Axum Server
participant Metrics as Metrics Exporter
participant Health as Health Loop
participant Queues as Task Queues
Operator->>Serve: start()
Serve->>JoinSet: init + CancellationToken
Serve->>Router: spawn serve(listener, router, cancellation_token)
Serve->>Metrics: start exporter(metrics_port, cancellation_token)
Serve->>Health: spawn_update_health_checks(join_set, cancellation_token)
Serve->>Queues: task_queues_runner(cancellation_token)
Note right of Serve: monitor JoinSet (join_next_with_id)
Operator-->>Serve: cancel token (Ctrl+C / SIGTERM)
Serve->>JoinSet: signal cancellation
par graceful shutdown
Router->>Serve: with_graceful_shutdown(token.cancelled)
Metrics->>Serve: exporter returns on cancel
Health->>Serve: loops exit on cancel
Queues->>Serve: workers exit / record status
and timeout path
Serve->>JoinSet: wait 20s
Serve->>JoinSet: abort remaining tasks
end
Serve->>Operator: shutdown complete
sequenceDiagram
autonumber
participant Registry as TaskQueueRegistry
participant Runner as TaskQueuesRunner
participant Worker as Queue Worker
participant Catalog as Catalog
participant Task as SpecializedTask<Q,D>
participant Publisher as EventPublisher
Registry->>Runner: task_queues_runner(cancellation_token)
loop worker lifecycle
Runner->>Worker: spawn worker(token)
Worker->>Catalog: poll_for_new_task::<Q,D>(interval, token)
alt task available
Catalog-->>Worker: Some(Task)
Worker->>Task: process (instrumented)
Task->>Catalog: record_success / record_failure
Worker->>Publisher: publish events(using TableIdentToIdFn)
else no task or cancelled
Worker-->>Runner: exit (graceful)
end
end
Estimated code review effort🎯 5 (Critical) | ⏱️ ~150 minutes Possibly related PRs
Poem
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (7)
crates/lakekeeper/src/catalog/views/commit.rs (1)
345-351: Mismatch in error type: "SetProperties" path returns "AddSchemaError".Likely a copy/paste. This breaks error analytics/alerts and misleads clients.
Apply:
- ViewUpdate::SetProperties { updates } => m.set_properties(updates).map_err(|e| { - ErrorModel::bad_request( - format!("Error setting properties: {e}"), - "AddSchemaError", - Some(Box::new(e)), - ) - })?, + ViewUpdate::SetProperties { updates } => m.set_properties(updates).map_err(|e| { + ErrorModel::bad_request( + format!("Error setting properties: {e}"), + "SetPropertiesError", + Some(Box::new(e)), + ) + })?,crates/lakekeeper/src/service/authz/implementations/openfga/api.rs (1)
1382-1384: Bug: route path parameter name is wrong for view accessThe router mounts
/permissions/view/{table_id}/accessbut the handler expects a{view_id}path parameter (and the OpenAPI annotation above uses{view_id}). This will lead to path-parameter extraction errors and mismatched OpenAPI docs.Apply this fix:
- .route( - "/permissions/view/{table_id}/access", - get(get_view_access_by_id), - ) + .route( + "/permissions/view/{view_id}/access", + get(get_view_access_by_id), + )crates/lakekeeper/src/implementations/postgres/task_queues.rs (2)
151-166: Stale-running pickup ignores queue filter (cross-queue pickup risk)In the stale-running branch of the CTE, the condition does not constrain
t.queue_name = $1. This allows picking up stale tasks from other queues when scanning this queue. Add the same queue filter to the second branch.Proposed change:
- WHERE (status = $3 AND t.queue_name = $1 - AND scheduled_for < now() AT TIME ZONE 'UTC') - OR (status = $4 AND (now() - last_heartbeat_at) > COALESCE(tc.max_time_since_last_heartbeat, $2)) + WHERE (status = $3 AND t.queue_name = $1 + AND scheduled_for < now() AT TIME ZONE 'UTC') + OR (status = $4 AND t.queue_name = $1 + AND (now() - last_heartbeat_at) > COALESCE(tc.max_time_since_last_heartbeat, $2))Also applies to: 158-161
467-515: Force-cancel condition matches every status when true (over-deletes tasks)In the warehouse-wide cancellation, the predicate
(status = $3 OR $5)becomes tautologically true when$5is true, deleting tasks regardless of status. The intent per function doc is “pending tasks,” optionally including running tasks whenforce_delete_running_tasksis true.Refine the condition to include only
Scheduledand, if requested,Running:- FROM task - WHERE (status = $3 OR $5) AND warehouse_id = $1 AND queue_name = $2 + FROM task + WHERE (status = $3 OR ($5 AND status = $6)) + AND warehouse_id = $1 AND queue_name = $2 ) - DELETE FROM task - WHERE (status = $3 OR $5) AND warehouse_id = $1 AND queue_name = $2 + DELETE FROM task + WHERE (status = $3 OR ($5 AND status = $6)) + AND warehouse_id = $1 AND queue_name = $2And update the parameters to pass
TaskStatus::Runningas the new$6:)? - .map_err(|e| { + .map_err(|e| { tracing::error!( ?e, "Failed to cancel {queue_name} Tasks for warehouse {warehouse_id}" ); e.into_error_model(format!( "Failed to cancel {queue_name} Tasks for warehouse {warehouse_id}" )) })?;- *warehouse_id, - queue_name, - TaskStatus::Scheduled as _, - TaskOutcome::Cancelled as _, - force_delete_running_tasks + *warehouse_id, + queue_name, + TaskStatus::Scheduled as _, + TaskOutcome::Cancelled as _, + force_delete_running_tasks, + TaskStatus::Running as _,This change keeps the behavior constrained to Scheduled tasks by default and optionally includes Running tasks when requested.
Also applies to: 493-499, 496-497
crates/lakekeeper/src/tests/mod.rs (2)
299-316: Renamespawn_build_in_queues→spawn_built_in_queues
To maintain consistency withregister_built_in_queues, the helper should be renamed and all its usages updated.Affected locations:
- Function definition
- crates/lakekeeper/src/tests/mod.rs: lines 299–316
- Call-sites
- crates/lakekeeper/src/tests/drop_warehouse.rs: line 109
- crates/lakekeeper/src/tests/stats.rs: line 30
Suggested diff:
--- a/crates/lakekeeper/src/tests/mod.rs +++ b/crates/lakekeeper/src/tests/mod.rs @@ -299,7 +299,7 @@ pub(crate) fn spawn_build_in_queues<T: Authorizer>( ctx: &ApiContext<State<T, PostgresCatalog, SecretsState>>, poll_interval: Option<std::time::Duration>, - cancellation_token: tokio_util::sync::CancellationToken, -) -> tokio::task::JoinHandle<()> { +) cancellation_token: tokio_util::sync::CancellationToken, +) -> tokio::task::JoinHandle<()> { let ctx = ctx.clone(); @@ tokio::task::spawn(task_runner.run_queue_workers(true)) } @@ -pub(crate) fn spawn_build_in_queues<T: Authorizer>( +pub(crate) fn spawn_built_in_queues<T: Authorizer>( ctx: &ApiContext<State<T, PostgresCatalog, SecretsState>>, poll_interval: Option<std::time::Duration>, cancellation_token: tokio_util::sync::CancellationToken,--- a/crates/lakekeeper/src/tests/drop_warehouse.rs +++ b/crates/lakekeeper/src/tests/drop_warehouse.rs @@ -106,7 +106,7 @@ // ... let queues_future = spawn_build_in_queues( - &setup.ctx, + &setup.ctx, Some(Duration::from_millis(10)), cancellation_token.clone(), );--- a/crates/lakekeeper/src/tests/stats.rs +++ b/crates/lakekeeper/src/tests/stats.rs @@ -27,7 +27,7 @@ // ... - spawn_build_in_queues(&setup.ctx, None, cancellation_token.clone()); + spawn_built_in_queues(&setup.ctx, None, cancellation_token.clone());Please update these locations and all imports accordingly. Happy to help with a follow-up patch if needed!
299-316: Ensure spawned queue workers are cleaned up in tests
The newspawn_build_in_queuesreturns aJoinHandle<()>, but I couldn’t find any.abort()or.awaitcalls in the tests—this will leak background tasks and can cause unpredictable test behavior. Please update the following tests to explicitly abort and await the handle on teardown:• crates/lakekeeper/src/tests/drop_warehouse.rs at line 109
• crates/lakekeeper/src/tests/stats.rs at line 30You can add cleanup like:
// after test logic, before exiting: queues_future.abort(); let _ = queues_future.await;and in stats.rs:
let queues_future = spawn_build_in_queues(&setup.ctx, None, cancellation_token.clone()); // … test logic … queues_future.abort(); let _ = queues_future.await;crates/lakekeeper/src/service/event_publisher/mod.rs (1)
78-129: Remove unnecessary dereferences inEventMetadataconstructorsThe code currently dereferences identifiers (
*table_id,*table_ident_uuid,*view_ident_uuid) even though those IDs are already owned values. This not only causes compilation errors but is also semantically incorrect. Apply the following fixes acrosscrates/lakekeeper/src/service/event_publisher/mod.rs:• In
commit_transaction(around line 110):- tabular_id: TabularId::Table(*table_id), + tabular_id: TabularId::Table(table_id),• In the “create table” handler (around line 143):
- tabular_id: TabularId::Table(*table_ident_uuid), + tabular_id: TabularId::Table(table_ident_uuid),• In the “drop table” handler (around line 234):
- tabular_id: TabularId::Table(*table_ident_uuid), + tabular_id: TabularId::Table(table_ident_uuid),• In the “create view” handler (around line 333):
- tabular_id: TabularId::View(*view_ident_uuid), + tabular_id: TabularId::View(view_ident_uuid),• In the “drop view” handler (around line 365):
- tabular_id: TabularId::View(*view_ident_uuid), + tabular_id: TabularId::View(view_ident_uuid),Additionally:
- If
TableId/ViewIdare notCopy, ensure your collection types (e.g.,Vec<(TableIdent, TableId)>) and function signatures reflect ownership or useArc<…>/cloning as needed.- Consider logging a warning wherever an identifier lookup fails (e.g., in
commit_transaction’selsebranch) to aid in debugging missing mappings.
🧹 Nitpick comments (35)
crates/iceberg-ext/src/catalog/rest/error.rs (3)
105-124: Consider de-duplicating the “Caused by:” label and trimming trailing newlineToday, Display prints a “Caused by:” header (Line 117) and error_chain_fmt also prints “Caused by:” for deeper sources. For single-source errors this is fine (as your test asserts exactly one label), but for multi-cause chains this produces repeated headers. If you want a single header followed by the entire cause chain, you can remove the explicit header here and let error_chain_fmt handle the chain formatting, or adjust error_chain_fmt to emit a single top-level header.
This is non-blocking; current behavior is acceptable and matches the test. Flagging as a readability choice in multi-cause scenarios.
259-271: Broaden append API to avoid unnecessary String allocations and add a non-consuming variantBoth append_details/append_detail require owned Strings and consume self. Consider:
- Accept an IntoIterator<Item = S> where S: Into to allow &str and reduce pre-allocation at call sites.
- Provide &mut self variants to enable in-place mutation (useful when callers don’t want to rebuild the wrapper).
Proposed diff within this hunk:
impl IcebergErrorResponse { #[must_use] - pub fn append_details(mut self, details: impl IntoIterator<Item = String>) -> Self { + pub fn append_details<I, S>(mut self, details: I) -> Self + where + I: IntoIterator<Item = S>, + S: Into<String>, + { - self.error.stack.extend(details); + self.error.stack.extend(details.into_iter().map(Into::into)); self } #[must_use] pub fn append_detail(mut self, detail: impl Into<String>) -> Self { self.error.stack.push(detail.into()); self } }If you like, I can follow up with a patch adding non-consuming
extend_details(&mut self, ...)/push_detail(&mut self, ...)variants.
286-315: Tighten server-error detection; drop redundant 401/403 checkThe
![401, 403].contains(&code)guard is redundant because the left-hand predicate iscode >= 500. Prefer an explicit 5xx range or StatusCode helpers.Minimal change:
- let mut response = if code >= 500 && ![401, 403].contains(&code) { + let mut response = if (500..=599).contains(&code) { tracing::error!(%error_id, %stack_s, ?details, %message, %r#type, %code, "Error response"); axum::Json(IcebergErrorResponse { error: ErrorModel { message, r#type, code, source: None, stack: vec![format!("Error ID: {error_id}")], }, }) .into_response() } else { // Log at info level for 4xx errors tracing::info!(%error_id, %stack_s, ?details, %message, %r#type, %code, "Error response");Alternatively:
- let mut response = if code >= 500 && ![401, 403].contains(&code) { + let mut response = if axum::http::StatusCode::from_u16(code).map(|s| s.is_server_error()).unwrap_or(true) {Functionally equivalent here, just cleaner/clearer.
crates/lakekeeper/src/catalog/io.rs (1)
156-166: Avoid cloningmessageunnecessarilyTwo arms call
message.to_string()even thoughmessageis already an owned String. You can move it directly into the constructors to avoid extra allocations.- IOErrorExt::Deserialization(_) | IOErrorExt::InvalidLocation(_) => { - ErrorModel::bad_request(message.to_string(), typ, Some(boxed)) - } + IOErrorExt::Deserialization(_) | IOErrorExt::InvalidLocation(_) => { + ErrorModel::bad_request(message, typ, Some(boxed)) + } IOErrorExt::IOError(e) => { let context = e .context() .iter() .map(ToString::to_string) .collect::<Vec<_>>(); - ErrorModel::bad_request(message.to_string(), typ, Some(boxed)) + ErrorModel::bad_request(message, typ, Some(boxed)) .append_details(context) }crates/io/src/lib.rs (4)
34-44: safe_usize_to_i32: scoped behind the right features; minor consistency nits.
- Gating to s3/gcs matches where this is used (multipart part numbers, GCS max_results). Good.
- Consider aligning error wording and kind usage across all conversion helpers for consistency with error.rs. If you have a more specific kind than ConditionNotMatch (e.g., InvalidArgument/Overflow), switching to it would make downstream handling more expressive.
Would you like me to scan error.rs and propose a consistent ErrorKind across these helpers?
46-55: safe_usize_to_i64: optionally gate to the backends that use it.This helper is referenced by ADLS and GCS paths; S3 appears to use the i32 variant. You can optionally tighten compilation with a feature gate to reduce surface area for builds that don’t include those backends.
Apply this diff to gate compilation:
-/// Fallible usize→i64 conversion with contextual diagnostics. -pub(crate) fn safe_usize_to_i64(value: usize, context: impl Into<String>) -> Result<i64, IOError> { +#[cfg(any(feature = "storage-adls", feature = "storage-gcs"))] +/// Fallible usize→i64 conversion with contextual diagnostics. +pub(crate) fn safe_usize_to_i64(value: usize, context: impl Into<String>) -> Result<i64, IOError> {Also, if error.rs offers a more specific variant than ConditionNotMatch for range/overflow issues, consider using it here to align with how these errors are surfaced elsewhere.
57-82: validate_file_size: good allocation-on-error pattern; add boundary tests.
- Moving location to impl Into and only materializing it on error paths is a nice improvement.
- Messages and kind (ConditionNotMatch) are coherent with the conversion helpers; if you do standardize the kind there, mirror it here too.
Adding a couple of unit tests here (negative, >usize::MAX on 32-bit CI, and a large-but-valid size) would lock in the behavior. I can draft those if helpful.
506-507: Macro invocation covers Arc and Box as intended.Good placement and visibility. Consider a brief doc comment near the invocation to indicate why Rc/Weak aren’t supported (trait requires Send+Sync, Weak would need upgrade semantics).
crates/iceberg-ext/Cargo.toml (1)
43-45: Ensure in-memory storage feature remains test-onlyThe
storage-in-memoryfeature is indeed used to gate both library code and integration tests in thelakekeeper-iocrate, so enabling it in your dev-dependency will activate all memory storage paths across the dependency graph duringcargo test. If that’s intended, you’re all set; otherwise isolate or narrow its scope to avoid test-only behavior leaking into library builds.• Gated library code in
lakekeeper-io(crates/io/src/lib.rs):
–#[cfg(feature = "storage-in-memory")] pub mod memory;
–StorageBackend::Memoryvariants and their match arms (e.g. delete, write, read, list, remove_all)
• Gated tests inlakekeeper-io(crates/io/tests/integration_tests.rs):
–#[cfg(feature = "storage-in-memory")]on helper and test functions
• Your dev-dependency remains:lakekeeper-io = { path = "../io", default-features = false, features = ["storage-in-memory"] }Recommendations:
– If you only need memory storage in tests, this setup matches your needs.
– Otherwise, guard test-only code viacfg(test)in the dependent crate or introduce a narrower feature (e.g.test-memory) to prevent behavior drift between test and release builds.crates/lakekeeper/Cargo.toml (1)
102-102: Optional: consider gating axum/axum-extra behindrouterto slim no-router builds.If the intent is to minimize dependency footprint when
routeris off, consider makingaxumandaxum-extraoptional and adding them to therouterfeature list. Not blocking for this PR.crates/lakekeeper/src/catalog/views/commit.rs (1)
141-147: Jittered exponential backoff: solid implementation and sane caps.Cap at 50ms*2^6 and half-span jitter reduces thundering herd; logging helps observability. Nice touch with saturating ops.
If we end up using similar backoff elsewhere, consider extracting a small helper (e.g., compute_backoff_delay(attempt, base_ms, cap_exp)) for reuse and unit tests.
crates/lakekeeper/src/service/mod.rs (1)
493-497: Sweep complete – no lingering.identusages found.All code references to the old
identfield have been removed, and the public rename totable_idis fully in place. As noted, a brief rustdoc onTabularDetailswill improve discoverability:• Location to add docs:
crates/lakekeeper/src/service/mod.rsat theTabularDetailsdefinition (around lines 493–497)Suggested diff:
--- a/crates/lakekeeper/src/service/mod.rs +++ b/crates/lakekeeper/src/service/mod.rs @@ -492,6 +492,9 @@ pub struct TabularDetails { pub table_id: TableId, pub location: String, } + +/// Metadata for a tabular dataset, including its unique `table_id` and +/// the storage `location` where its data lives. #[derive(Debug, Clone)] pub struct TabularDetails { pub table_id: TableId,crates/lakekeeper/src/implementations/postgres/task_queues.rs (2)
47-66: Nit: rename localstatestopayloadsfor clarityNow that the domain term is “payload/data,” the local
statesvariable naming is confusing. Renaming improves readability.- let mut states = Vec::with_capacity(tasks.len()); + let mut payloads = Vec::with_capacity(tasks.len()); @@ - states.push(payload); + payloads.push(payload); @@ - &states, + &payloads,Also applies to: 111-114
134-151: Optional: guard against negative durations when building PgIntervalIf
max_time_since_last_heartbeatcould be negative (from a misconfiguration), the conversion will succeed but semantics are odd. Consider clamping to zero or validating upstream. Not a blocker.Would you like a follow-up patch to clamp negative durations here and in
set_task_queue_config?crates/lakekeeper/src/api/router.rs (1)
245-255: Graceful shutdown wired to CancellationToken — LGTMUsing
with_graceful_shutdown(cancellation_token.cancelled().await)integrates cleanly with the orchestrator inserve.rs. Consider logging a message once the cancellation future resolves for easier operational observability, but not required.If you want a tiny enhancement:
- let cancellation_future = async move { cancellation_token.cancelled().await }; + let cancellation_future = async move { + cancellation_token.cancelled().await; + tracing::info!("HTTP server shutdown requested (cancellation token)"); + };docs/docs/table-maintenance.md (1)
1-6: Clear, concise doc; minor wording polish.Nice summary of the retention behavior and defaults. Consider tightening the last sentence and explicitly tying deletion to the metadata log to remove any ambiguity.
Apply this diff:
-Lakekeeper honors the Iceberg table properties `write.metadata.delete-after-commit.enabled` and `write.metadata.previous-versions-max`. Starting with Lakekeeper v0.10.0, `delete-after-commit` is enabled by default (it was disabled in earlier versions). On each table commit, when `delete-after-commit` is enabled, Lakekeeper keeps the current table metadata file plus up to `write.metadata.previous-versions-max` previous metadata files (default: 100) and deletes the oldest tracked metadata file once that limit is exceeded. This cleanup applies only to metadata files tracked in the metadata log; it does not remove orphaned metadata files. +Lakekeeper honors the Iceberg table properties `write.metadata.delete-after-commit.enabled` and `write.metadata.previous-versions-max`. Starting with Lakekeeper v0.10.0, `delete-after-commit` is enabled by default (it was disabled in earlier versions). On each table commit, when `delete-after-commit` is enabled, Lakekeeper keeps the current table metadata file plus up to `write.metadata.previous-versions-max` previous metadata files (default: 100) and deletes the oldest tracked metadata file from the metadata log once that limit is exceeded. This cleanup applies only to metadata files tracked in the metadata log; it does not remove orphaned metadata files.Would you like a follow-up PR to add cross-links to Iceberg’s “metadata log” docs and Lakekeeper’s orphan cleanup guidance to help users navigate related maintenance tasks?
crates/lakekeeper/src/metrics.rs (1)
45-55: Good use of tokio::select! for cooperative shutdown; minor idiomatic tweaks.The cancellation branch is correct and drops the exporter future cleanly. Two small improvements:
- Use
anyhow!directly instead ofanyhow!(format!(...)).- Include the port in the cancellation log to aid operators when multiple exporters run.
Apply this diff:
- tokio::select! { - () = cancellation_token.cancelled() => { - tracing::info!("Metrics exporter cancelled"); - Ok(()) - }, - r = exporter => { - r.map_err(|e| anyhow::anyhow!(format!("Metrics exporter failed: {e:?}"))) - } - } + tokio::select! { + () = cancellation_token.cancelled() => { + tracing::info!(port = metrics_port, "Metrics exporter cancelled"); + Ok(()) + }, + r = exporter => { + r.map_err(|e| anyhow::anyhow!("Metrics exporter failed: {e:?}")) + } + }crates/lakekeeper/src/tests/drop_warehouse.rs (1)
108-113: Nice: cancellable workers and captured JoinHandle. Consider renaming and eliminating fixed sleeps.
- The variable
queues_futureis aJoinHandle<()>. Consider renaming toqueues_handlefor clarity.- The subsequent fixed
sleep(2s)can be flaky if purge takes longer than two poll intervals. Prefer polling with a deadline and small backoff untildelete_warehousesucceeds.Apply this diff to replace the fixed sleep with a robust poll:
- // Wait for tables to be dropped - tokio::time::sleep(std::time::Duration::from_secs(2)).await; - // Drop warehouse - this should succeed now - ApiServer::delete_warehouse( - warehouse.warehouse_id, - DeleteWarehouseQuery::builder().build(), - api_context.clone(), - random_request_metadata(), - ) - .await - .expect("Warehouse deletion should succeed after purge tasks are completed"); + // Drop warehouse — poll until purge tasks complete to avoid flakiness + let deadline = std::time::Instant::now() + std::time::Duration::from_secs(15); + loop { + match ApiServer::delete_warehouse( + warehouse.warehouse_id, + DeleteWarehouseQuery::builder().build(), + api_context.clone(), + random_request_metadata(), + ) + .await { + Ok(_) => break, + Err(e) if std::time::Instant::now() < deadline => { + tokio::time::sleep(std::time::Duration::from_millis(200)).await; + } + Err(e) => panic!("Warehouse deletion did not complete within 15s: {e:?}"), + } + }crates/lakekeeper/src/api/mod.rs (1)
26-74: Graceful shutdown via CancellationToken looks solid; minor nits on consistency and panicsOverall, the select! logic and signal handling are correct, and the external-cancellation branch is a nice touch. Two small suggestions:
- Unify error messages and terminology (“install” vs “register”, capitalization) across Ctrl+C/SIGTERM/SIGINT for consistency.
- Consider logging and returning instead of panicking on handler registration failures, unless a hard fail here is desired in all deployments (the current docstring still says “Panics…”).
Apply this diff if you want consistent wording and non-panicking registration on Unix signals:
#[cfg(feature = "router")] pub async fn shutdown_signal(cancellation_token: tokio_util::sync::CancellationToken) { use tokio::signal; @@ let ctrl_c = async { signal::ctrl_c() .await - .expect("failed to install Ctrl+C handler"); + .expect("Failed to register Ctrl+C handler"); }; @@ #[cfg(unix)] let terminate = async { - signal::unix::signal(signal::unix::SignalKind::terminate()) - .expect("Failed to register SIGTERM handler") - .recv() - .await; + match signal::unix::signal(signal::unix::SignalKind::terminate()) { + Ok(mut s) => { s.recv().await; } + Err(e) => { + tracing::error!("Failed to register SIGTERM handler: {e}"); + return; + } + } }; @@ #[cfg(unix)] let interrupt = async { - signal::unix::signal(signal::unix::SignalKind::interrupt()) - .expect("Failed to register SIGINT handler") - .recv() - .await; + match signal::unix::signal(signal::unix::SignalKind::interrupt()) { + Ok(mut s) => { s.recv().await; } + Err(e) => { + tracing::error!("Failed to register SIGINT handler: {e}"); + return; + } + } };crates/lakekeeper/src/service/event_publisher/mod.rs (2)
423-476: Channel-based publisher: backpressure handling is good; consider including queue length metricsYou already warn on send_timeout failures. If feasible, expose a gauge/counter for dropped events to make this observable in metrics.
512-586: Background task fan-out: safe and robust; minor improvement on error context
join_allintentionally swallows individual sink errors after logging. If you ever need stronger delivery guarantees, considertry_join_allwith per-sink retry/backoff, but current behavior is acceptable for best-effort emissions.crates/lakekeeper/src/service/endpoint_hooks.rs (2)
75-78: Introduce TableIdentToIdFn: good abstraction; document lifetime expectationsNice move away from cloning large maps into hooks. Because hooks receive
&TableIdentToIdFn, clarify in docs that implementations must not hold onto this reference beyond the scope of the call (e.g., don’t store it for later async work). If long-lived use is needed, we can switch to passingArc<dyn TableIdentToIdFn + Send + Sync>.Proposed doc addition:
/// Function type used by hooks to resolve a `TableIdent` to its `TableId`. -/// Implementations should be cheap and non-blocking. +/// Implementations should be cheap and non-blocking. +/// Note: Hooks receive this as a borrowed reference valid only for the duration of the call. +/// Do not store it for use outside the async method invocation. pub type TableIdentToIdFn = dyn Fn(&TableIdent) -> Option<TableId> + Send + Sync;
367-375: Trait signature change: commit_transaction now takes a resolver fn — good, but call out non-retentionThe new parameter
_table_ident_to_id_fn: &TableIdentToIdFnis an improvement. As above, consider adding a note in trait docs that the resolver must not be retained or invoked after the method returns.crates/lakekeeper/src/service/task_queue/tabular_expiration_queue.rs (1)
217-219: Consider verifying transaction state before recording success.The code records success in the transaction before committing it. While this follows the transactional pattern, ensure that
record_success_in_transactiondoesn't assume the transaction will definitely commit.Consider adding a comment to clarify the transactional semantics:
+ // Record success within the transaction - will be rolled back if commit fails task.record_success_in_transaction::<C>(trx.transaction(), None) .await;crates/lakekeeper/src/service/health.rs (1)
27-27: Consider documenting the jitter range choice.The jitter range of 0-500ms seems reasonable for health checks, but it would be helpful to document why this specific range was chosen.
- // Jitter is a random value between 0 and 500 milliseconds (inclusive) + // Jitter is a random value between 0 and 500 milliseconds (inclusive) + // to prevent thundering herd when multiple services start simultaneously let jitter = fastrand::u64(0..=500);crates/lakekeeper/src/catalog/tables.rs (2)
955-956: Consider handling the return value.The function discards the return value from
commit_tables_with_authz. While this is intentional for the transaction endpoint, consider if any useful information could be logged.- let _ = commit_tables_with_authz(prefix, request, state, request_metadata).await?; + let contexts = commit_tables_with_authz(prefix, request, state, request_metadata).await?; + tracing::debug!("Successfully committed {} table(s)", contexts.len());
1865-1866: String parsing for boolean could be more strict.The current implementation accepts "1" as true, which might be unexpected. Consider being more explicit about accepted values.
- v.to_lowercase() == "true" || v == "1" + matches!(v.to_lowercase().as_str(), "true" | "yes" | "on" | "1")Or alternatively, use a standard boolean parser:
- v.to_lowercase() == "true" || v == "1" + v.parse::<bool>().unwrap_or(false)crates/lakekeeper/src/service/task_queue/tabular_purge_queue.rs (4)
37-41: QueueConfig impl OK; consider explicit overrides for retries/heartbeatLeaving max_retries and max_time_since_last_heartbeat at defaults is fine, but purge can be IO-bound and flaky; a slightly higher retry budget and a shorter heartbeat may improve resilience/latency. If desired, override via static fns on PurgeQueueConfig.
63-70: Add task_id to the span for easier cross-log correlationYou already log queue_name, location, and attempt. Including task_id in the span makes correlating success/failure records and DB state much easier during ops.
Apply this diff to enrich the span:
let span = tracing::debug_span!( QUEUE_NAME, location = %task.data.tabular_location, warehouse_id = %task.task_metadata.warehouse_id, tabular_type = %task.data.tabular_type, queue_name = %task.queue_name(), attempt = %task.attempt, + task_id = %task.task_id, );
88-90: Consider recording a brief success message for operator visibilityCurrently success is recorded with None; a short message helps when scanning task_history without needing to cross-reference structured logs.
Apply this minimal diff (uses a static str to avoid borrow issues in async calls):
- task.record_success::<C>(catalog_state, None).await; + task.record_success::<C>(catalog_state, Some("Purged tabular data")).await;
135-141: Unify error conversion style for consistencyElsewhere in this file you convert to IcebergErrorResponse explicitly. While the “?” here likely leverages From for IcebergErrorResponse, using the same explicit style improves readability and avoids confusion.
Suggested change:
- let tabular_location = Location::from_str(tabular_location_str).map_err(|e| { - ErrorModel::internal( - format!("Failed to parse table location `{tabular_location_str}` to purge table data."), - "ParseError", - Some(Box::new(e)), - ) - })?; + let tabular_location = Location::from_str(tabular_location_str).map_err(|e| { + IcebergErrorResponse::from(ErrorModel::internal( + format!("Failed to parse table location `{tabular_location_str}` to purge table data."), + "ParseError", + Some(Box::new(e)), + )) + })?;crates/lakekeeper/src/service/task_queue/mod.rs (4)
64-66: Add Send + Sync + 'static bounds to TaskDataSpecializedTask
instances flow through async tasks and may cross threads. Requiring payloads to be Send + Sync + 'static at the trait level prevents accidentally registering non-sendable payloads that could break under multi-threaded runtimes.
Apply this diff:
-/// Task Payload -pub trait TaskData: Clone + Serialize + DeserializeOwned {} +/// Task Payload +pub trait TaskData: Clone + Serialize + DeserializeOwned + Send + Sync + 'static {}
212-259: Passing poll_interval by reference is fine; consider by-value to simplify lifetimesThe closures capture poll_interval by value and pass &poll_interval to async fns. This compiles, but passing Duration by value to workers (and taking Duration in worker signatures) removes the interior borrowing entirely and avoids subtle lifetime pitfalls for future refactors.
If you decide to do this, adjust worker signatures to take Duration (not &Duration) and drop the ampersand at call sites.
692-739: report_deserialization_failure could include queue name in messageYou log the queue in append_detail, but the stored error message is just “Failed to deserialize task data: …”. Consider prefixing with Q::queue_name() for quicker context in DB history rows (even without details expansion).
Apply this diff:
- format!("Failed to deserialize task data: {error}").as_str(), + format!("Queue `{}`: failed to deserialize task data: {error}", Q::queue_name()).as_str(),
1008-1141: Test harness covers cancellation-based shutdownSpawning the runner with a CancellationToken and cancelling at the end validates the new shutdown semantics. Consider adding a purge-queue integration test mirroring expiration to exercise the new purge worker end-to-end as well.
Happy to sketch an integration test for purge similar to test_queue_expiration_queue_task if you want.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (36)
Cargo.toml(1 hunks)crates/iceberg-ext/Cargo.toml(1 hunks)crates/iceberg-ext/src/catalog/rest/error.rs(6 hunks)crates/io/Cargo.toml(0 hunks)crates/io/src/lib.rs(4 hunks)crates/lakekeeper/Cargo.toml(3 hunks)crates/lakekeeper/src/api/mod.rs(2 hunks)crates/lakekeeper/src/api/router.rs(3 hunks)crates/lakekeeper/src/catalog/io.rs(2 hunks)crates/lakekeeper/src/catalog/tables.rs(30 hunks)crates/lakekeeper/src/catalog/views/commit.rs(2 hunks)crates/lakekeeper/src/implementations/postgres/catalog.rs(1 hunks)crates/lakekeeper/src/implementations/postgres/tabular/mod.rs(2 hunks)crates/lakekeeper/src/implementations/postgres/tabular/table/mod.rs(6 hunks)crates/lakekeeper/src/implementations/postgres/task_queues.rs(8 hunks)crates/lakekeeper/src/lib.rs(2 hunks)crates/lakekeeper/src/metrics.rs(2 hunks)crates/lakekeeper/src/serve.rs(6 hunks)crates/lakekeeper/src/service/authz/implementations/openfga/api.rs(2 hunks)crates/lakekeeper/src/service/authz/mod.rs(2 hunks)crates/lakekeeper/src/service/catalog.rs(3 hunks)crates/lakekeeper/src/service/endpoint_hooks.rs(2 hunks)crates/lakekeeper/src/service/event_publisher/mod.rs(2 hunks)crates/lakekeeper/src/service/health.rs(2 hunks)crates/lakekeeper/src/service/mod.rs(1 hunks)crates/lakekeeper/src/service/secrets.rs(1 hunks)crates/lakekeeper/src/service/task_queue/mod.rs(21 hunks)crates/lakekeeper/src/service/task_queue/tabular_expiration_queue.rs(4 hunks)crates/lakekeeper/src/service/task_queue/tabular_purge_queue.rs(2 hunks)crates/lakekeeper/src/tests/drop_warehouse.rs(3 hunks)crates/lakekeeper/src/tests/mod.rs(2 hunks)crates/lakekeeper/src/tests/stats.rs(2 hunks)crates/lakekeeper/src/tests/tasks.rs(5 hunks)docs/docs/table-maintenance.md(1 hunks)docs/mkdocs.yml(1 hunks)tests/python/tests/test_spark.py(1 hunks)
💤 Files with no reviewable changes (1)
- crates/io/Cargo.toml
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-22T05:44:22.632Z
Learnt from: c-thiel
PR: lakekeeper/lakekeeper#1298
File: crates/lakekeeper/src/service/secrets.rs:11-11
Timestamp: 2025-08-22T05:44:22.632Z
Learning: In crates/lakekeeper/src/implementations/kv2.rs, there is a separate `impl std::fmt::Debug for SecretsState` implementation that provides Debug support for the KV2 SecretsState type, so it already satisfies Debug trait bounds without needing a derive macro.
Applied to files:
crates/lakekeeper/src/service/secrets.rs
📚 Learning: 2025-08-22T05:44:22.632Z
Learnt from: c-thiel
PR: lakekeeper/lakekeeper#1298
File: crates/lakekeeper/src/service/secrets.rs:11-11
Timestamp: 2025-08-22T05:44:22.632Z
Learning: In crates/lakekeeper/src/implementations/kv2.rs, the SecretsState struct has a manual `impl std::fmt::Debug` implementation (lines 239-249) that properly redacts sensitive fields like vault_password (shows "REDACTED") and replaces complex objects like vault_client with simple string representations. This is the correct approach for Debug implementations on secret-handling types.
Applied to files:
crates/lakekeeper/src/service/secrets.rs
🧬 Code graph analysis (18)
crates/lakekeeper/src/lib.rs (2)
crates/lakekeeper/src/request_metadata.rs (2)
determine_base_uri(294-363)determine_forwarded_prefix(282-292)crates/lakekeeper/src/api/iceberg/mod.rs (1)
metrics(62-62)
crates/lakekeeper/src/implementations/postgres/tabular/mod.rs (1)
crates/lakekeeper/src/service/tabular_idents.rs (2)
typ_str(24-29)typ_str(69-74)
crates/lakekeeper/src/tests/stats.rs (1)
crates/lakekeeper/src/tests/mod.rs (2)
random_request_metadata(295-297)spawn_build_in_queues(299-316)
crates/lakekeeper/src/catalog/views/commit.rs (1)
crates/lakekeeper/src/service/authn.rs (3)
try_from(342-344)try_from(350-359)try_from(365-367)
crates/lakekeeper/src/api/router.rs (1)
crates/lakekeeper/src/serve.rs (1)
serve(134-398)
crates/iceberg-ext/src/catalog/rest/error.rs (1)
crates/lakekeeper/src/catalog/io.rs (5)
from(108-113)from(117-122)from(126-131)from(141-168)from(172-175)
crates/lakekeeper/src/serve.rs (4)
crates/lakekeeper/src/api/mod.rs (3)
std(53-53)std(56-56)shutdown_signal(27-75)crates/lakekeeper/src/service/task_queue/mod.rs (4)
task(605-605)task(617-617)new(171-176)len(270-272)crates/lakekeeper/src/api/router.rs (1)
serve(245-255)crates/lakekeeper/src/metrics.rs (1)
get_axum_layer_and_install_recorder(20-57)
crates/lakekeeper/src/tests/drop_warehouse.rs (1)
crates/lakekeeper/src/tests/mod.rs (3)
get_api_context(268-293)random_request_metadata(295-297)spawn_build_in_queues(299-316)
crates/lakekeeper/src/catalog/io.rs (2)
crates/iceberg-ext/src/catalog/rest/error.rs (5)
failed_dependency(219-230)internal(161-172)bad_request(127-133)from(28-30)from(40-47)crates/io/src/error.rs (1)
context(277-279)
crates/lakekeeper/src/service/task_queue/tabular_expiration_queue.rs (3)
crates/lakekeeper/src/service/task_queue/mod.rs (8)
tabular_purge_queue(246-246)queue_name(61-61)queue_name(741-743)task(605-605)task(617-617)poll_for_new_task(645-690)from(460-462)from(466-468)crates/lakekeeper/src/service/task_queue/tabular_purge_queue.rs (4)
SpecializedTask(51-51)queue_name(38-40)task(89-89)task(96-96)crates/lakekeeper/src/service/catalog.rs (3)
drop_table(463-467)drop_view(731-735)queue_tabular_purge(884-904)
crates/lakekeeper/src/service/event_publisher/mod.rs (1)
crates/lakekeeper/src/catalog/tables.rs (4)
request(1056-1060)request(1204-1208)request(1284-1350)maybe_body_to_json(1918-1925)
crates/lakekeeper/src/service/task_queue/tabular_purge_queue.rs (5)
crates/lakekeeper/src/catalog/io.rs (2)
remove_all(74-79)e(159-163)crates/lakekeeper/src/catalog/mod.rs (2)
maybe_get_secret(68-77)new(101-120)crates/iceberg-ext/src/catalog/rest/error.rs (6)
new(232-244)internal(161-172)from(28-30)from(40-47)from(61-63)from(67-69)crates/lakekeeper/src/service/task_queue/mod.rs (8)
new(171-176)queue_name(61-61)queue_name(741-743)task(605-605)task(617-617)poll_for_new_task(645-690)from(460-462)from(466-468)crates/lakekeeper/src/service/storage/mod.rs (1)
file_io(146-182)
crates/lakekeeper/src/service/endpoint_hooks.rs (1)
crates/lakekeeper/src/service/event_publisher/mod.rs (1)
commit_transaction(80-128)
crates/lakekeeper/src/service/health.rs (1)
crates/lakekeeper/src/implementations/mod.rs (2)
health(112-118)update_health(120-126)
crates/io/src/lib.rs (4)
crates/io/src/error.rs (5)
context(277-279)new(14-20)new(215-223)new(342-349)location(259-261)crates/io/src/adls/adls_storage.rs (5)
new(88-93)write(199-280)read(300-378)read_single(282-298)list(380-441)crates/io/src/gcs/gcs_storage.rs (5)
new(49-51)write(151-273)read(300-386)read_single(275-298)list(388-464)crates/io/src/s3/s3_storage.rs (4)
write(85-246)read(248-322)read_single(324-347)list(349-440)
crates/lakekeeper/src/tests/tasks.rs (1)
crates/lakekeeper/src/service/task_queue/mod.rs (6)
queue_name(61-61)queue_name(741-743)new(171-176)task(605-605)task(617-617)pick_new_task(593-641)
crates/lakekeeper/src/service/task_queue/mod.rs (6)
crates/lakekeeper/src/service/task_queue/tabular_expiration_queue.rs (5)
queue_name(43-45)tabular_expiration_worker(48-82)task(102-102)task(217-217)SpecializedTask(55-55)crates/lakekeeper/src/service/task_queue/tabular_purge_queue.rs (5)
queue_name(38-40)tabular_purge_worker(43-76)task(89-89)task(96-96)SpecializedTask(51-51)crates/iceberg-ext/src/catalog/rest/error.rs (2)
new(232-244)internal(161-172)crates/lakekeeper/src/service/catalog.rs (5)
pick_new_task(795-799)begin_write(57-57)record_task_failure(805-810)transaction(65-65)record_task_success(800-804)crates/lakekeeper/src/implementations/postgres/catalog.rs (3)
pick_new_task(701-712)record_task_failure(723-736)record_task_success(714-721)crates/lakekeeper/src/implementations/postgres/task_queues.rs (2)
record_failure(268-328)record_success(223-266)
crates/lakekeeper/src/catalog/tables.rs (3)
crates/lakekeeper/src/service/catalog.rs (6)
load_storage_profile(753-757)resolve_table_ident(759-764)transaction(65-65)load_tables(421-426)commit_table_transaction(487-491)commit(61-61)crates/iceberg-ext/src/catalog/rest/error.rs (3)
internal(161-172)new(232-244)bad_request(127-133)crates/lakekeeper/src/catalog/io.rs (2)
e(159-163)delete_file(27-32)
🪛 LanguageTool
docs/docs/table-maintenance.md
[grammar] ~6-~6: There might be a mistake here.
Context: ...eletes the oldest tracked metadata file.
(QB_NEW_EN)
🪛 GitHub Actions: integration tests
crates/iceberg-ext/src/catalog/rest/error.rs
[error] 300-300: NamespaceActionForbidden (404): Namespace not found or action can_get_metadata forbidden for Principal(oidc~9410d0bf-4487-4177-a34f-af364cac0a59)
⏰ 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). (9)
- GitHub Check: security_audit
- GitHub Check: docker / docker
- GitHub Check: docker / docker
- GitHub Check: docker / docker
- GitHub Check: docker / docker
- GitHub Check: clippy
- GitHub Check: test
- GitHub Check: check-generated-openapi-matches
- GitHub Check: sqlx-check
There was a problem hiding this comment.
Actionable comments posted: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
crates/lakekeeper/src/catalog/io.rs (2)
140-175: Reclassification of IOError as 400 risks sensitive detail leakage; prefer Failed Dependency or redact.Mapping IOErrorExt::IOError to a 400 Bad Request while appending backend context exposes internal/storage details to clients (4xx paths preserve stack per IntoResponse). IO failures are typically backend/infra issues, not client faults. Recommend classifying as Failed Dependency (424) and/or redacting these details in responses.
Apply this diff to reclassify IO errors to 424:
- IOErrorExt::IOError(e) => { - let context = e - .context() - .iter() - .map(ToString::to_string) - .collect::<Vec<_>>(); - ErrorModel::bad_request(message, typ, Some(boxed)).append_details(context) - } + IOErrorExt::IOError(e) => { + let context = e + .context() + .iter() + .map(ToString::to_string) + .collect::<Vec<_>>(); + ErrorModel::failed_dependency(message, typ, Some(boxed)).append_details(context) + }Follow-up in iceberg-ext suggested below ensures 424 responses get the same redaction treatment as 5xx.
63-71: Misclassified join error on deserialize path.If spawn_blocking fails (JoinError), it’s not a decompression error. This mislabeling confuses downstream error handling and status codes. Map it to Deserialization with a custom serde_json error message instead.
- { - Ok(result) => result, - Err(e) => Err(IOErrorExt::FileDecompression(Box::new(e))), - } + { + Ok(result) => result, + Err(e) => Err(IOErrorExt::Deserialization( + serde_json::Error::custom(format!("spawn_blocking failed: {e}")), + )), + }
♻️ Duplicate comments (3)
crates/lakekeeper/src/tests/stats.rs (1)
29-31: Clean shutdown implemented correctly (captures + awaits JoinHandle).You addressed the earlier concern: the worker handle is now captured and awaited after cancellation, preventing leaked background tasks and DB connection contention in tests. Nicely done.
Also applies to: 121-122
crates/iceberg-ext/src/catalog/rest/error.rs (2)
367-427: Great Display tests.These validate header/message/stack/caused-by formatting paths. This addresses prior feedback to cover formatting behavior.
429-488: IntoResponse tests lock in redaction and Error ID behaviors.Solid coverage for 5xx redaction and 4xx preservation with Error ID propagation.
🧹 Nitpick comments (15)
crates/io/tests/integration_tests.rs (1)
1393-1401: Deterministic RNG via fastrand is solid; small readability nit: lift the seed to a named constant.This keeps tests reproducible and avoids thread-local global RNG. Defining a constant seed makes intent clearer and eases future tweaks.
Apply within this hunk:
- let mut rng = fastrand::Rng::with_seed(42); + const RNG_SEED: u64 = 42; + let mut rng = fastrand::Rng::with_seed(RNG_SEED);If you need to support older fastrand versions that might lack
Rng::fill, a portable fallback is:- rng.fill(&mut chunk); + // Portable fallback if Rng::fill is unavailable in older fastrand: + for b in &mut chunk { + *b = rng.u8(); + }(Only necessary if CI flags the method; current code is preferred.)
crates/lakekeeper/src/tests/stats.rs (1)
32-42: Harden initial stats fetch to avoid first-poll race.Fetching stats immediately after starting the workers can still race with the first producer tick and occasionally yield an empty page. Consider a short deadline-bound retry before asserting, to reduce flakiness.
Apply this diff to wrap the initial fetch with a 2s retry window:
- let stats = ApiServer::get_warehouse_statistics( - whi, - GetWarehouseStatisticsQuery { - page_token: PageToken::NotSpecified, - page_size: None, - }, - setup.ctx.clone(), - random_request_metadata(), - ) - .await - .unwrap(); + let stats = { + let deadline = std::time::Instant::now() + Duration::from_secs(2); + loop { + let s = ApiServer::get_warehouse_statistics( + whi, + GetWarehouseStatisticsQuery { + page_token: PageToken::NotSpecified, + page_size: None, + }, + setup.ctx.clone(), + random_request_metadata(), + ) + .await + .unwrap(); + if !s.stats.is_empty() || std::time::Instant::now() >= deadline { + break s; + } + tokio::time::sleep(Duration::from_millis(100)).await; + } + };crates/lakekeeper/src/tests/drop_warehouse.rs (2)
115-132: Deletion retry loop is pragmatic; consider tightening naming.The bounded retry avoids flakes while purge tasks complete. Minor naming nit: the spawned JoinHandle isn’t a "future"; rename for clarity.
- let queues_future = spawn_build_in_queues( + let queues_handle = spawn_build_in_queues( &api_context, Some(std::time::Duration::from_secs(1)), cancellation_token.clone(), ); @@ - queues_future.await.unwrap(); + queues_handle.await.unwrap();
108-135: Option: use timeout to simplify retry control flow.An alternative to manual deadline arithmetic is tokio::time::timeout over a small loop, which makes the failure mode clearer. Not required, just a readability option.
docs/docs/table-maintenance.md (2)
6-6: Tiny wording tweak for flow.Consider tightening the example sentence for readability.
Apply this diff:
-For example: if `write.metadata.previous-versions-max=20`, Lakekeeper retains 21 files in total (the current plus 20 previous); committing a 22nd version deletes the oldest tracked metadata file. +For example, if `write.metadata.previous-versions-max=20`, Lakekeeper retains 21 files in total (the current file plus 20 previous). On the 22nd commit, Lakekeeper deletes the oldest tracked metadata file from the metadata log.
3-4: Add an ops caveat about rollback horizon.Since enabling delete-after-commit shrinks the metadata log, rollbacks/branching to older points may become impossible once entries fall off the log. A short note recommending setting a sufficiently high write.metadata.previous-versions-max for workloads that rely on rollback would prevent surprises.
I can draft a one-liner and link to your disaster-recovery/rollback docs if you’d like.
crates/lakekeeper/src/catalog/tables.rs (4)
1038-1088: Validation improves error specificity and duplicate detection.Requiring an identifier and producing a human-readable duplicate list is great. Minor improvement: include counts to speed up debugging in multi-change transactions.
- let dups = counts + let dups = counts .into_iter() - .filter(|&(_i, c)| (c > 1)) - .map(|(i, _c)| i.to_string()) + .filter(|&(_i, c)| c > 1) + .map(|(i, c)| format!("{i} (x{c})")) .collect::<Vec<_>>() .join(", ");
1090-1172: Retry + jittered exponential backoff: solid concurrency posture.
- Capped exponent and jitter reduce thundering herds.
- Keeping attempt state local and returning original errors preserves debuggability.
Two small nits:
- The log currently prints attempt as 0-based; consider logging attempt + 1 to match “human” expectations.
- Make MAX_RETRIES_ON_CONCURRENT_UPDATE configurable (env/flag) for large deployments.
- tracing::info!( + tracing::info!( warehouse_id = %warehouse_id, n_tables = %table_ids.len(), - attempt = attempt, + attempt = attempt + 1, max_attempts = MAX_RETRIES_ON_CONCURRENT_UPDATE, "Concurrent update detected, retrying commit operation" );If you want, I can provide a small config hook to source MAX_RETRIES and base delay from state or env with sane defaults.
1390-1423: Best-effort cleanup on DB failure is the right trade-off; add correlation for observability.The write-then-DB-commit strategy with compensating deletes is correct. To aid incident triage, consider including a correlation id (e.g., commit attempt UUID) in both the write and delete logs.
- tracing::warn!("Failed to delete metadata file after failed commit: {e:?}"); + tracing::warn!(%warehouse_id, attempt, location=%commit.new_metadata_location, "Failed to delete metadata file after failed commit: {e:?}");Note: include attempt or a generated correlation id at the top of the try_commit_tables call to thread through logs.
1863-1868: Broaden “truthy” parsing for delete-after-commit.Supporting common truthy values reduces footguns when properties are set via env or external tooling.
- matches!(v.to_lowercase().as_str(), "true" | "yes" | "1") + matches!(v.to_lowercase().as_str(), "true" | "yes" | "1" | "on" | "y" | "t")crates/lakekeeper/src/service/task_queue/tabular_purge_queue.rs (5)
26-33: Typed payload is clean; consider exposing schema for API docsTabularPurgePayload is minimal and correct. If this payload is surfaced via management APIs or admin tooling, deriving ToSchema would integrate it into Utoipa-generated docs.
Apply this diff to derive ToSchema as well (harmless if unused):
-#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] pub(crate) struct TabularPurgePayload { pub(crate) tabular_location: String, pub(crate) tabular_type: TabularType, }
73-73: Type args can be omitted for readabilityinstrumented_purge::<_, C>(...) is correct but a bit opaque. Type inference can handle both generics here; consider letting the compiler infer to reduce visual noise.
- instrumented_purge::<_, C>(catalog_state.clone(), &secret_state, &task) + instrumented_purge(catalog_state.clone(), &secret_state, &task) .instrument(span.or_current()) .await;
110-118: Function shape is good; consider ordering generics as <C, S> consistentlypurge<C, S>(...) contrasts with instrumented_purge<S, C>(...). Consider standardizing generic parameter order across helpers to reduce mental friction.
137-143: Minor wording: use “tabular data” for consistencyNit on the error message; everything else looks solid (and you retain the source for stack traces).
- format!("Failed to parse table location `{tabular_location_str}` to purge table data."), + format!("Failed to parse table location `{tabular_location_str}` to purge tabular data."),
153-161: Preserving error classification from file_io init (good); consider the same for IO remove laterMapping file_io init errors via IcebergErrorResponse::from(e) keeps non-internal classifications and stacks. For consistency, consider doing the same for remove_all (see next comment), or add a From for IcebergErrorResponse so we don’t need to wrap in ErrorModel::internal.
Do you want me to open a follow-up PR to introduce From for IcebergErrorResponse and apply it here?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (21)
Cargo.toml(1 hunks)crates/iceberg-ext/Cargo.toml(1 hunks)crates/iceberg-ext/src/catalog/rest/error.rs(6 hunks)crates/io/Cargo.toml(1 hunks)crates/io/src/lib.rs(4 hunks)crates/io/tests/integration_tests.rs(1 hunks)crates/lakekeeper/src/api/mod.rs(1 hunks)crates/lakekeeper/src/api/router.rs(3 hunks)crates/lakekeeper/src/catalog/io.rs(2 hunks)crates/lakekeeper/src/catalog/tables.rs(30 hunks)crates/lakekeeper/src/implementations/kv2.rs(1 hunks)crates/lakekeeper/src/implementations/postgres/tabular/mod.rs(2 hunks)crates/lakekeeper/src/implementations/postgres/task_queues.rs(11 hunks)crates/lakekeeper/src/metrics.rs(2 hunks)crates/lakekeeper/src/service/endpoint_hooks.rs(2 hunks)crates/lakekeeper/src/service/mod.rs(1 hunks)crates/lakekeeper/src/service/task_queue/tabular_expiration_queue.rs(4 hunks)crates/lakekeeper/src/service/task_queue/tabular_purge_queue.rs(2 hunks)crates/lakekeeper/src/tests/drop_warehouse.rs(2 hunks)crates/lakekeeper/src/tests/stats.rs(2 hunks)docs/docs/table-maintenance.md(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- crates/lakekeeper/src/implementations/kv2.rs
🚧 Files skipped from review as they are similar to previous changes (11)
- Cargo.toml
- crates/lakekeeper/src/implementations/postgres/tabular/mod.rs
- crates/lakekeeper/src/implementations/postgres/task_queues.rs
- crates/iceberg-ext/Cargo.toml
- crates/lakekeeper/src/metrics.rs
- crates/lakekeeper/src/service/mod.rs
- crates/lakekeeper/src/api/mod.rs
- crates/lakekeeper/src/service/endpoint_hooks.rs
- crates/lakekeeper/src/service/task_queue/tabular_expiration_queue.rs
- crates/lakekeeper/src/api/router.rs
- crates/io/src/lib.rs
🧰 Additional context used
🧬 Code graph analysis (6)
crates/lakekeeper/src/tests/drop_warehouse.rs (1)
crates/lakekeeper/src/tests/mod.rs (3)
get_api_context(268-293)random_request_metadata(295-297)spawn_build_in_queues(299-316)
crates/lakekeeper/src/tests/stats.rs (1)
crates/lakekeeper/src/tests/mod.rs (2)
random_request_metadata(295-297)spawn_build_in_queues(299-316)
crates/lakekeeper/src/service/task_queue/tabular_purge_queue.rs (5)
crates/lakekeeper/src/catalog/io.rs (2)
remove_all(74-79)e(159-163)crates/lakekeeper/src/catalog/mod.rs (2)
maybe_get_secret(68-77)new(101-120)crates/iceberg-ext/src/catalog/rest/error.rs (6)
new(232-244)internal(161-172)from(28-30)from(40-47)from(61-63)from(67-69)crates/lakekeeper/src/service/task_queue/mod.rs (8)
new(171-176)queue_name(61-61)queue_name(741-743)task(605-605)task(617-617)poll_for_new_task(645-690)from(460-462)from(466-468)crates/lakekeeper/src/service/storage/mod.rs (1)
file_io(146-182)
crates/lakekeeper/src/catalog/tables.rs (5)
crates/lakekeeper/src/service/catalog.rs (7)
load_storage_profile(753-757)resolve_table_ident(759-764)transaction(65-65)load_tables(421-426)table_idents_to_ids(411-416)commit_table_transaction(487-491)commit(61-61)crates/lakekeeper/src/implementations/postgres/tabular/table/mod.rs (5)
load_storage_profile(426-454)resolve_table_ident(49-78)load_tables(457-656)format(1095-1097)table_idents_to_ids(80-112)crates/iceberg-ext/src/catalog/rest/error.rs (3)
internal(161-172)new(232-244)bad_request(127-133)crates/lakekeeper/src/catalog/io.rs (2)
e(159-163)delete_file(27-32)crates/lakekeeper/src/implementations/postgres/tabular/table/commit.rs (2)
commit_table_transaction(23-97)commits(32-35)
crates/lakekeeper/src/catalog/io.rs (2)
crates/iceberg-ext/src/catalog/rest/error.rs (7)
failed_dependency(219-230)internal(161-172)bad_request(127-133)from(28-30)from(40-47)from(61-63)from(67-69)crates/io/src/error.rs (1)
context(277-279)
crates/iceberg-ext/src/catalog/rest/error.rs (1)
crates/lakekeeper/src/catalog/io.rs (5)
from(108-113)from(117-122)from(126-131)from(141-167)from(171-174)
🪛 LanguageTool
docs/docs/table-maintenance.md
[grammar] ~6-~6: There might be a mistake here.
Context: ...eletes the oldest tracked metadata file.
(QB_NEW_EN)
⏰ 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). (8)
- GitHub Check: sqlx-check
- GitHub Check: check-generated-openapi-matches
- GitHub Check: clippy
- GitHub Check: test
- GitHub Check: docker / docker
- GitHub Check: docker / docker
- GitHub Check: docker / docker
- GitHub Check: docker / docker
🔇 Additional comments (23)
crates/io/Cargo.toml (1)
78-78: All directranddependencies and imports have been removed — workspace now consistently usesfastrand. The absence of anyrand =entries inCargo.tomlfiles and nouse rand::orextern crate randin the Rust sources confirms the migration is complete. Therandentries inCargo.lockare from transitive dependencies and expected.– Cargo.toml manifests: no
rand =lines found
– Rust code: nouse rand::orextern crate randoccurrences
–fastrandis declared and used consistently across cratesNo further changes needed here.
crates/lakekeeper/src/tests/drop_warehouse.rs (2)
108-114: Good use of CancellationToken + awaiting the worker.Spawning with a token and awaiting the JoinHandle at teardown ensures no worker leakage between tests. The 1s poll interval is a sensible choice for this test.
23-24: Imports align with the new helper.Importing spawn_build_in_queues alongside the existing helpers keeps the test module consistent with the harness refactor.
crates/lakekeeper/src/catalog/io.rs (1)
170-175: Bridging to IcebergErrorResponse looks good.The From -> ErrorModel and bridging impl to IcebergErrorResponse preserve compatibility while centralizing classification in ErrorModel.
crates/iceberg-ext/src/catalog/rest/error.rs (3)
33-37: Display delegation is correct.Implementing Display for IcebergErrorResponse via its inner ErrorModel keeps formatting consistent across types.
66-70: Bridging conversion is appropriate.From for ErrorModel is a useful addition for cross-crate conversions.
105-124: ErrorModel Display reads well and includes stack and cause chains.Clear, structured formatting that’s helpful in logs and developer diagnostics.
docs/docs/table-maintenance.md (1)
3-4: Clear, actionable doc — thanks for shipping this alongside the behavior change.The explanation of the two properties and the per-commit retention behavior is concise and matches the implementation intent. Calling out that orphan cleanup is out of scope is particularly helpful for operators.
crates/lakekeeper/src/catalog/tables.rs (7)
979-1012: Returning TabularDetails from authz path improves ergonomics.Passing TabularDetails through authz and deriving storage permissions inline reduces re-loading and avoids extra round-trips. LGTM.
1015-1031: Nice extraction: load_table_inner centralizes staged checks and not-found handling.This removes duplication and ensures consistent 404/staged semantics across callers.
1256-1281: Good transaction scoping before I/O.Committing the read transaction before external I/O avoids holding DB locks while waiting on storage. This aligns with the two-phase commit approach adopted below.
1870-1894: Property whitelist looks correct and protects against unsupported keys.Guarding write.metadata.* to the known set and blocking write.data.path avoids subtle misconfigurations. LGTM.
955-957: API surface simplifications: single-path commit and credential loading improvements.
- commit_transaction delegates to commit_tables_with_authz: clearer surface with consistent validation and retry behavior.
- commit_table now reuses the same path and ensures exactly one CommitContext (debug_assert is a nice extra check).
- load_table[_credentials] use TabularDetails.table_id and free DB transactions before doing storage work.
Also applies to: 663-685, 615-619, 530-538
2137-2149: Tests updated to the new entry point: good coverage retained.Switching tests to commit_tables_with_authz maintains end-to-end semantics, and the expire-metadata-log scenario still asserts the intended metadata parity. LGTM.
Also applies to: 2296-2311, 2353-2368, 2438-2452, 2490-2501, 2529-2540, 2572-2583, 2652-2664, 2714-2726, 2771-2783, 2810-2821
1151-1156: No changes needed for the fastrand dependencyI’ve confirmed that
fastrandis declared in the workspace’s root Cargo.toml (line 162) and is pulled intocrates/lakekeeper/Cargo.tomlunder[dependencies]asfastrand = { workspace = true }. The backoff implementation can safely rely on it without further CI adjustments.crates/lakekeeper/src/service/task_queue/tabular_purge_queue.rs (8)
3-3: Good move: adopt IcebergErrorResponse for richer error propagationImporting ErrorModel and IcebergErrorResponse aligns with the PR goal of returning error stacks and adds consistency to downstream handling.
9-9: Trait imports look correct; Transaction in scope enables associated fn callsBringing QueueConfig/QueueApiConfig, SpecializedTask/TaskData, and the Transaction trait into scope is necessary for the new typed queue flow and for calling C::Transaction::begin_read.
Also applies to: 13-16
37-41: QueueConfig impl is straightforward and consistentReturning the static QUEUE_NAME keeps the SpecializedTask plumbing simple.
46-56: Cancellation-aware polling: solid integrationSwitching to SpecializedTask::<PurgeQueueConfig, TabularPurgePayload>::poll_for_new_task with a CancellationToken and &Duration poll interval is correct and avoids unnecessary clones.
59-60: Graceful shutdown message is helpfulExiting the worker on cancellation with an info log avoids noisy error paths during shutdown.
79-85: Signature change fits the new SpecializedTask flowTaking &SpecializedTask in instrumented_purge and threading it into purge centralizes context and simplifies success/failure recording.
119-136: Good: limit DB tx scope to metadata fetch; warn on commit failureStarting a read tx just to load the warehouse and committing before IO avoids long-held DB txs during remote deletes. Warning on commit failure is pragmatic here.
20-24: No changes needed:LazyLockis supported by the MSRVThe workspace’s minimum supported Rust version is 1.86.0 (as declared in Cargo.toml), and
std::sync::LazyLockwas stabilized in Rust 1.80.0. Since 1.86.0 ≥ 1.80.0, usingLazyLockeverywhere in the codebase (including intabular_purge_queue.rs) is safe. (blog.rust-lang.org)
✅ PR Title Formatted CorrectlyThe title of this PR match the correct format. Thank you! |
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (3)
crates/iceberg-ext/src/catalog/rest/error.rs (3)
429-458: Nice — 5xx redaction test added as previously requestedThis locks the server-error branch and “Error ID” behavior. Thanks for adding it.
459-488: Great — 4xx preservation test added as previously requestedCovers the client-error path and Error ID appending.
286-315: Adjust redaction to only server-side and failed-dependency errorsThe current logic at crates/iceberg-ext/src/catalog/rest/error.rs (line 286) treats 401/403 as “redacted,” which contradicts the PR’s goal of “return[ing] error stacks for non-internal errors.” We should reserve stack redaction (and error-level logging) for true server-side faults (5xx) and Failed Dependency (424), while preserving client error stacks (including 401/403) with an appended Error ID.
Locations to update:
- File:
crates/iceberg-ext/src/catalog/rest/error.rs- Around line 286 (the
if code >= 500 || [401, 403, 424].contains(&code)branch)Suggested diff:
- let mut response = if code >= 500 || [401, 403, 424].contains(&code) { + let redact = code >= 500 || code == StatusCode::FAILED_DEPENDENCY.as_u16(); + let mut response = if redact { tracing::error!(%error_id, %stack_s, ?details, %message, %r#type, %code, "Error response"); axum::Json(IcebergErrorResponse { error: ErrorModel { message, r#type, code, source: None, stack: vec![format!("Error ID: {error_id}")], }, }) .into_response() } else { // Log at info level for 4xx errors tracing::info!(%error_id, %stack_s, ?details, %message, %r#type, %code, "Error response"); let mut details = details; details.push(format!("Error ID: {error_id}")); axum::Json(IcebergErrorResponse { error: ErrorModel { message, r#type, code, source: None, stack: details, }, }) .into_response() };Add tests to lock in behavior:
@@ #[tokio::test] +async fn test_into_response_failed_dependency_redacts_stack_and_adds_error_id() { /*…*/ } @@ #[tokio::test] +async fn test_into_response_unauthorized_preserves_stack_and_adds_error_id() { /*…*/ }Ensure imports for
axum::http::StatusCodeand any necessary traits.
🧹 Nitpick comments (3)
crates/iceberg-ext/src/catalog/rest/error.rs (3)
105-121: Avoid duplicate “Caused by:” labels and extra blank lines in Display outputCurrent formatting prints “Caused by:” in Display and again inside error_chain_fmt for deeper chains, and also introduces an extra blank line. Streamline the helper to print causes without its own header, and keep the single header in Display.
Apply this diff:
- fn error_chain_fmt(e: impl std::error::Error, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - writeln!(f, "{e}\n")?; - let mut current = e.source(); - while let Some(cause) = current { - writeln!(f, "Caused by:\n\t{cause}")?; - current = cause.source(); - } - Ok(()) - } + fn error_chain_fmt(e: &(dyn StdError), f: &mut Formatter<'_>) -> std::fmt::Result { + // Print the first source, then each subsequent cause (no extra headers). + writeln!(f, "\t{e}")?; + let mut current = e.source(); + while let Some(cause) = current { + writeln!(f, "\t{cause}")?; + current = cause.source(); + } + Ok(()) + }And keep a single header in Display (no functional change here, just relies on the adjusted helper):
impl Display for ErrorModel { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { writeln!(f, "{} ({}): {}", self.r#type, self.code, self.message)?; @@ if let Some(source) = self.source.as_ref() { - writeln!(f, "Caused by:")?; - // Dereference `source` to get `dyn StdError` and then take a reference to pass - error_chain_fmt(&**source, f)?; + writeln!(f, "Caused by:")?; + error_chain_fmt(&**source, f)?; } Ok(()) } }Also applies to: 50-58
259-271: Public appenders on IcebergErrorResponse are handy; consider non-consuming variantsThe consuming builder-style methods are great for pipelines. For handlers that already have a mutable value, non-consuming helpers reduce moves/allocations.
Proposed additive API (keeps current methods intact):
impl IcebergErrorResponse { #[must_use] pub fn append_details(mut self, details: impl IntoIterator<Item = String>) -> Self { self.error.stack.extend(details); self } #[must_use] pub fn append_detail(mut self, detail: impl Into<String>) -> Self { self.error.stack.push(detail.into()); self } + + // Optional: non-consuming variants + pub fn push_detail(&mut self, detail: impl Into<String>) { + self.error.stack.push(detail.into()); + } + + pub fn extend_details(&mut self, details: impl IntoIterator<Item = String>) { + self.error.stack.extend(details); + } }
367-427: Display tests are solid; add a multi-cause assertionGreat coverage for empty stack, with stack, and with a source. To guard regressions in the “causes” formatting, add a test where the source has its own source, asserting that only one “Caused by:” header is printed and both causes appear (after applying the helper refactor above).
Example to add:
#[test] fn test_error_model_display_with_nested_sources() { // innermost cause (no source) let inner = std::io::Error::new(std::io::ErrorKind::Other, "root cause"); // wrap it once let middle = anyhow::anyhow!(inner).context("mid layer"); // wrap again as the ErrorModel source let source_error = Box::new(middle) as Box<dyn std::error::Error + Send + Sync + 'static>; let error = ErrorModel { message: "top".into(), r#type: "Chained".into(), code: 500, source: Some(source_error), stack: vec![], }; let out = format!("{error}"); assert!(out.contains("Caused by:")); // exactly one header even with nested causes assert_eq!(out.matches("Caused by:").count(), 1); assert!(out.contains("mid layer")); assert!(out.contains("root cause")); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
crates/iceberg-ext/src/catalog/rest/error.rs(6 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
crates/iceberg-ext/src/catalog/rest/error.rs (1)
crates/lakekeeper/src/catalog/io.rs (5)
from(108-113)from(117-122)from(126-131)from(141-167)from(171-174)
⏰ 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). (10)
- GitHub Check: docker / docker
- GitHub Check: docker / docker
- GitHub Check: docker / docker
- GitHub Check: docker / docker
- GitHub Check: sqlx-check
- GitHub Check: test
- GitHub Check: check-generated-openapi-matches
- GitHub Check: clippy
- GitHub Check: openfga
- GitHub Check: security_audit
🔇 Additional comments (2)
crates/iceberg-ext/src/catalog/rest/error.rs (2)
33-37: Display delegation for IcebergErrorResponse looks goodSimple, clear delegation to the inner ErrorModel’s Display implementation.
66-70: Symmetric conversion added (IcebergErrorResponse -> ErrorModel)Useful for ergonomics and aligns with the existing ErrorModel -> IcebergErrorResponse conversion.
* 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]>
BEGIN_COMMIT_OVERRIDE
feat: Simplify task interface, re-exports
feat: Enable write.metadata.delete-after-commit.enabled by default
feat: Return Error Stacks for non-internal errors
END_COMMIT_OVERRIDE
Summary by CodeRabbit
New Features
Improvements
Documentation