Repository navigation
feat: Table & View Ops Abstractions, Improved Error Handling - #1454
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 WalkthroughRefactors authorization to use per-entity associated action types and info objects; converts many CatalogStore APIs to richer info/impl variants; changes namespace lookups to return Option; unifies tabular (table/view) representations and error types; and updates server and Postgres implementations to use the new authz/catalog surfaces. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Server
participant Catalog
participant AuthZ
rect rgb(220, 250, 220)
note right of Client: New info-driven authorization flow (high level)
Client->>Server: Request (table/view action)
Server->>Catalog: get_table_info/get_view_info(ident, flags, catalog_state)
Catalog-->>Server: TableInfo / ViewInfo
Server->>AuthZ: require_table_action(&TableInfo, action) / require_view_action(&ViewInfo, action)
AuthZ-->>Server: Ok(()) or specific AuthZ error
Server->>Server: proceed with business logic using TableInfo/ViewInfo
end
sequenceDiagram
participant Code
participant Authorizer
participant Backend
rect rgb(240, 255, 200)
note right of Code: Batch authorization (tabular mixed)
Code->>Authorizer: are_allowed_tabular_actions_vec([(&tab1_info, act1), (&view2_info, act2), ...])
Authorizer->>Backend: batch check (per-item with associated types)
Backend-->>Authorizer: Vec<bool>
Authorizer-->>Code: Vec<bool> (aligned to inputs)
end
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 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: 14
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (9)
crates/authz-openfga/src/relations.rs (1)
363-371: Bug: CanListUsers maps to CanListAllProjectsThis breaks permission checks for listing users. Map to CanListUsers instead.
- CatalogServerAction::CanListUsers => ServerRelation::CanListAllProjects, + CatalogServerAction::CanListUsers => ServerRelation::CanListUsers,crates/lakekeeper/src/service/catalog_store/namespace.rs (2)
111-151: HTTP status for invalid identifier should be 400, not 500
InvalidNamespaceIdentifierrepresents client input issues. Map to Bad Request.Apply:
impl From<InvalidNamespaceIdentifier> for ErrorModel { @@ - code: StatusCode::INTERNAL_SERVER_ERROR.as_u16(), + code: StatusCode::BAD_REQUEST.as_u16(),
254-267: AddFrom<InternalParseLocationError> for ErrorModelmapping in namespace.rsThe variant
InternalParseLocationErrorwas added toCatalogNamespaceDropErrorbut lacks error-to-model mapping. All other variant types (NamespaceNotFound, NamespaceProtected, etc.) have explicitFrom<Type> for ErrorModelimplementations in namespace.rs, but InternalParseLocationError does not. Without this, clients cannot properly deserialize the error response when this variant is returned. Add:impl From<InternalParseLocationError> for ErrorModel { fn from(err: InternalParseLocationError) -> Self { ErrorModel { code: StatusCode::INTERNAL_SERVER_ERROR.as_u16(), r#type: "InternalParseLocationError".to_string(), message: err.to_string(), stack: err.stack, source: None, } } }crates/lakekeeper/src/api/management/v1/namespace.rs (1)
34-42: Change authorization check fromCanDeletetoCanUpdatePropertiesfor namespace protection togglingThe operation modifies a namespace property (protection status), not deletes it. Since
CatalogNamespaceAction::CanDeleteis for namespace deletion andCanUpdatePropertiesis already used for namespace property modifications elsewhere, useCanUpdatePropertiesinstead.crates/lakekeeper/src/server/views/create.rs (2)
104-116: Remove unwrap; return a 400 on invalid view creation.Avoid panicking on malformed input. Map None to a BadRequest before assign_uuid.
- let view_creation = ViewMetadataBuilder::from_view_creation(ViewCreation { + let view_creation = ViewMetadataBuilder::from_view_creation(ViewCreation { name: view.name.clone(), location: view_location.to_string(), representations: request.view_version.representations().clone(), schema: request.schema.clone(), properties: request.properties.clone(), default_namespace: request.view_version.default_namespace().clone(), default_catalog: request.view_version.default_catalog().cloned(), summary: request.view_version.summary().clone(), - }) - .unwrap() - .assign_uuid(*view_id.as_ref()); + }) + .ok_or_else(|| { + ErrorModel::bad_request( + "Invalid view creation payload.", + "InvalidViewCreation", + None, + ) + })? + .assign_uuid(*view_id.as_ref());
97-103: Use a single, metadata-derived compression codec for both path and write.Currently, path is derived from request.properties while write uses metadata’s codec. This can desync extension vs. content. Build metadata first, derive codec from it once, then compute the metadata_location and reuse for write.
- let metadata_location = storage_profile.default_metadata_location( - &view_location, - &CompressionCodec::try_from_properties(&request.properties)?, - *view_id, - 0, - ); + // Build metadata first (above), then derive codec from finalized metadata. + let compression_codec = CompressionCodec::try_from_metadata(&metadata_build_result.metadata)?; + let metadata_location = storage_profile.default_metadata_location( + &view_location, + &compression_codec, + *view_id, + 0, + ); @@ - C::create_view( + C::create_view( warehouse_id, namespace.namespace_id, &view, - &metadata_build_result.metadata, + &metadata_build_result.metadata, &metadata_location, t.transaction(), ) @@ - let file_io = storage_profile.file_io(storage_secret.as_ref()).await?; - let compression_codec = CompressionCodec::try_from_metadata(&metadata_build_result.metadata)?; + let file_io = storage_profile.file_io(storage_secret.as_ref()).await?; @@ write_file( &file_io, &metadata_location, &metadata_build_result.metadata, compression_codec, )Also applies to: 117-124, 125-133, 140-146
crates/lakekeeper/src/server/views/load.rs (1)
36-43: Map NamespaceDepthExceeded to 404 (consistency with tables endpoint)Currently this swallows the validation error; it should return 404 like load_table to keep semantics consistent and avoid proceeding with an invalid ident.
Apply:
+use http::StatusCode; @@ - match validate_table_or_view_ident(&view) { - Ok(()) => {} - Err(e) => { - if e.error.r#type != *"NamespaceDepthExceeded" { - return Err(e); - } - } - } + if let Err(mut e) = validate_table_or_view_ident(&view) { + if e.error.r#type == *"NamespaceDepthExceeded" { + e.error.code = StatusCode::NOT_FOUND.into(); + } + return Err(e); + }crates/lakekeeper/src/implementations/postgres/tabular/view/load.rs (1)
150-181: Make array/jsonb aggregates deterministic and aligned (add ORDER BY).Without ORDER BY, ARRAY_AGG/JSONB_AGG return unspecified order, risking misaligned vectors across ids/schemas/timestamps/representations. Add a shared ORDER BY key per aggregate to guarantee alignment.
Suggested edits (adjust to actual column names):
-LEFT JOIN (SELECT view_id, - ARRAY_AGG(schema_id) AS schema_ids, - ARRAY_AGG(schema) AS schemas +LEFT JOIN (SELECT view_id, + ARRAY_AGG(schema_id ORDER BY schema_id) AS schema_ids, + ARRAY_AGG(schema ORDER BY schema_id) AS schemas ... -LEFT JOIN (SELECT view_id, - ARRAY_AGG(version_id) AS version_log_ids, - ARRAY_AGG(timestamp) AS version_log_timestamps +LEFT JOIN (SELECT view_id, + ARRAY_AGG(version_id ORDER BY timestamp) AS version_log_ids, + ARRAY_AGG(timestamp ORDER BY timestamp) AS version_log_timestamps ... -LEFT JOIN (SELECT vv.view_id, - JSONB_AGG(version_id) AS version_ids, - ARRAY_AGG(summary) AS summaries, - ARRAY_AGG(schema_id) AS version_schema_ids, - ARRAY_AGG(timestamp) AS version_timestamps, - ARRAY_AGG(default_namespace_id) AS version_default_namespace_ids, - ARRAY_AGG(default_catalog) AS version_default_catalogs, +LEFT JOIN (SELECT vv.view_id, + JSONB_AGG(vv.version_id ORDER BY vv.version_id) AS version_ids, + ARRAY_AGG(summary ORDER BY vv.version_id) AS summaries, + ARRAY_AGG(schema_id ORDER BY vv.version_id) AS version_schema_ids, + ARRAY_AGG(timestamp ORDER BY vv.version_id) AS version_timestamps, + ARRAY_AGG(default_namespace_id ORDER BY vv.version_id) AS version_default_namespace_ids, + ARRAY_AGG(default_catalog ORDER BY vv.version_id) AS version_default_catalogs, ... - SELECT view_id, view_version_id, - ARRAY_AGG(typ) as typ, - ARRAY_AGG(sql) as sql, - ARRAY_AGG(dialect) as dialect + SELECT view_id, view_version_id, + ARRAY_AGG(typ ORDER BY representation_id) as typ, + ARRAY_AGG(sql ORDER BY representation_id) as sql, + ARRAY_AGG(dialect ORDER BY representation_id) as dialectUse a stable representation key (e.g., representation_id/ordinal) across typ/sql/dialect. If such a column doesn’t exist, add one.
Also applies to: 151-156, 158-167
crates/lakekeeper/src/implementations/postgres/tabular/mod.rs (1)
393-406: Location-conflict check can miss children whenfs_locationends with “/” (double-slash in LIKE).
(TRIM(TRAILING '/' FROM fs_location) || '/') LIKE $4 || '/%'producesa/b//%if$4already ends with/. This may fail to detect conflicts.Normalize
$4too:- WHERE ta.warehouse_id = $1 AND (fs_location = ANY($2) OR - -- TODO: revisit this after knowing performance impact, may need an index - (length($4) < length(fs_location) AND ((TRIM(TRAILING '/' FROM fs_location) || '/') LIKE $4 || '/%')) + WHERE ta.warehouse_id = $1 AND ( + fs_location = ANY($2) + -- TODO: revisit this after knowing performance impact, may need an index + OR ( + length(TRIM(TRAILING '/' FROM $4)) < length(fs_location) + AND (TRIM(TRAILING '/' FROM fs_location) || '/') + LIKE (TRIM(TRAILING '/' FROM $4) || '/%') + ) + )Optional: also store
fs_locationnormalized (no trailing slash) on insert for simpler comparisons.
🧹 Nitpick comments (49)
crates/io/tests/integration_tests.rs (1)
1327-1331: Consider consistent debug output handling.The summary
println!is commented out, but the detailed per-item output loop remains active. This creates inconsistency in test debug output. Consider either removing all debug prints for clean test execution or keeping all for debugging purposes. Alternatively, use conditional compilation (#[cfg(test)]with an environment variable) or a proper test logging framework.Apply this diff to remove all debug output:
- // Debug output - // println!("Listed {} items in {}", listed_locations.len(), list_dir); - for loc in &listed_locations { - println!(" Found: {loc}"); - }Or apply this diff to restore the summary line for complete debug output:
// Debug output - // println!("Listed {} items in {}", listed_locations.len(), list_dir); + println!("Listed {} items in {}", listed_locations.len(), list_dir); for loc in &listed_locations { println!(" Found: {loc}"); }crates/io/src/location.rs (1)
30-45: host_str never returns None; consider non-Option APIhost_str always returns Some(...). Either document this or provide a non-Option variant to reduce unwrap noise for callers.
crates/io/src/lib.rs (1)
190-207: Doc nits: clarify read vs read_single semanticsMention that read returns the full object (implementation may fetch in chunks), and read_single forces a single backend request. Helps users choose intentionally.
crates/lakekeeper/src/implementations/postgres/tasks/get_task_details.rs (1)
44-44: Prefer Reverse for descending sort to avoid negation pitfallsUsing -r.attempt is less clear and risks overflow at i32::MIN.
- records.sort_by_key(|r| -r.attempt); + use std::cmp::Reverse; + records.sort_by_key(|r| Reverse(r.attempt));crates/lakekeeper/src/api/management/v1/warehouse/mod.rs (2)
908-979: Per-item authz masking + pagination — solid approachClosure builds UnfilteredPage with mask; fetch_until_full_page composes a full page. Two nits:
- Rename idents to infos for clarity (it holds ViewOrTableDeletionInfo).
- Inline a small comment noting that mask aligns with infos/ids/token order to aid maintainers.
981-1005: DeletedTabularResponse assembly — log/warn paths goodSkips items missing expiration_task and logs; OK. Optional: include warehouse_id + tabular_id in the warn for easier triage (you already log id).
crates/authz-openfga/src/check.rs (1)
244-274: De-duplicate table/view resolution helpersThe Name/Id matching, flags, and require_* calls are nearly identical between tables and views. Consider extracting a small helper to build the IdentOrId and fetch info, parameterized by kind and action, to reduce repetition and drift.
Also applies to: 287-317
crates/lakekeeper/src/api/management/v1/warehouse/undrop.rs (2)
34-53: Use a HashSet for presence checks (nit)You only need membership for missing detection. Building a HashSet from tabulars (instead of HashMap) trims memory and simplifies contains_key checks.
- let found_tabulars = tabulars - .iter() - .map(|t| (t.tabular_id(), t)) - .collect::<std::collections::HashMap<_, _>>(); + let found_ids = tabulars + .iter() + .map(|t| t.tabular_id()) + .collect::<std::collections::HashSet<_>>(); - let missing = request.targets.iter().filter(|id| !found_tabulars.contains_key(id)).collect::<Vec<_>>(); + let missing = request.targets.iter().filter(|id| !found_ids.contains(id)).collect::<Vec<_>>();
21-30: Tiny API ergonomics: add a flags ctorYou repeatedly construct flags with active+deleted. Consider a TabularListFlags::active_and_deleted() helper to centralize intent.
crates/lakekeeper/src/service/catalog_store/error.rs (1)
63-70: Dropping PartialEq/Eq may break tests/consumersdefine_transparent_error no longer derives PartialEq/Eq. If any tests compare these errors, they’ll fail. Either re-derive behind cfg(test) or update tests to pattern-match on variants/fields instead of equality.
crates/lakekeeper/src/service/authz/warehouse.rs (1)
73-86: Error message parity (optional)Consider aligning the forbidden message format with other entities (namespace/table/view) for consistent support UX and log filtering.
crates/lakekeeper/src/service/catalog_store/namespace.rs (2)
96-109: Avoid leaking internal error details in API errorsourceReturning
source: Some(Box::new(source))can leak internal parsing details to clients. Prefer logging internally and returning a sanitized error.Apply:
impl From<NamespacePropertiesSerializationError> for ErrorModel { @@ - ErrorModel { + let model = ErrorModel { r#type: "NamespacePropertiesSerializationError".to_string(), code: StatusCode::INTERNAL_SERVER_ERROR.as_u16(), message, stack, - source: Some(Box::new(source)), + source: None, - } + }; + // Consider: tracing::error!(error=?source, "Namespace properties serialization failed"); + model } }
382-389: Pass-throughget_namespaceOK; consider documenting Option semanticsLGTM. Consider adding a short doc: “Returns Ok(None) if namespace not found.”
/// Get a namespace by its ID or name. + /// Returns `Ok(None)` if the namespace does not exist.crates/lakekeeper/src/server/tabular.rs (1)
110-114: Minor: clarify tuple variable naming in unzip chain.Rename the inner tuple from “namespace” to something descriptive to reduce cognitive load.
- .map(|((allowed, namespace), token)| (namespace.0, namespace.1, token, allowed)) + .map(|((allowed, ident_and_id), token)| (ident_and_id.0, ident_and_id.1, token, allowed))crates/lakekeeper/src/server/views/exists.rs (1)
17-20: Consider consistent 404 mapping for invalid identifiersTables map NamespaceDepthExceeded to 404 to avoid leaking validation details; views-exists currently returns 400. Align for consistency?
If you want to align, I can draft a small patch mirroring the tables endpoint behavior.
crates/lakekeeper/src/server/tables/load_table.rs (1)
85-103: Optional: defer secret fetch when not neededThere's a TODO about fetching secrets even when data_access won’t use them. Consider gating maybe_get_secret behind the effective access mode to save a DB call.
crates/lakekeeper/src/implementations/postgres/pagination.rs (2)
90-92: Use consistent low-verbosity logging on parse errorsUse debug (not info) for noisy parse failures to reduce log chatter in prod.
Apply:
- tracing::info!("Could not parse timestamp from page token: {e}"); + tracing::debug!("Could not parse timestamp from page token: {e}"); ... - tracing::info!("Could not parse ID from page token: {e}"); + tracing::debug!("Could not parse ID from page token: {e}");Also applies to: 98-100
72-78: Avoid echoing full token in error detailsConsider redacting/truncating the token when constructing InvalidPaginationToken to prevent log/response bloat with untrusted input.
I can propose a small helper like redact_token(s: &str) -> String that caps to 128 chars if helpful.
Also applies to: 104-112
crates/lakekeeper/src/implementations/postgres/tabular/table/mod.rs (1)
228-234: Detect K/V length mismatches for properties.Zipping keys/values silently truncates on mismatch; this corrupts properties without signaling. Validate lengths and error out to surface DB inconsistencies.
Apply:
- let properties = self - .table_properties_keys - .unwrap_or_default() - .into_iter() - .zip(self.table_properties_values.unwrap_or_default()) - .collect::<HashMap<_, _>>(); + let keys = self.table_properties_keys.unwrap_or_default(); + let vals = self.table_properties_values.unwrap_or_default(); + if keys.len() != vals.len() { + return Err(RequiredTableComponentMissing::new(warehouse_id, table_id) + .append_detail(format!("Table properties K/V length mismatch: {} keys vs {} values", keys.len(), vals.len())) + .into()); + } + let properties = keys.into_iter().zip(vals).collect::<HashMap<_, _>>();crates/lakekeeper/src/implementations/postgres/tabular/load_by_location.rs (1)
64-66: Drop redundant LENGTH guard; rely on partial equality for index-friendly lookup.
ti.fs_location = ANY($2)already restricts to precomputed prefixes. The extraLENGTH(ti.fs_location) <= …adds CPU work and may defeat simple index plans without increasing correctness.Apply:
- AND LENGTH(ti.fs_location) <= $3And remove the
$3parameter computation. If you want true containment without precomputing partials, switch to a singleLIKE (TRIM(TRAILING '/' FROM ti.fs_location) || '/%')predicate guarded bywarehouse_idand consider an index on(warehouse_id, fs_location).Benchmark with and without LENGTH using
EXPLAIN ANALYZEon representative data.crates/lakekeeper/src/server/mod.rs (1)
34-80: Macro relies on inherent methods; document and constrain usage.Forwarding
self.properties()works for TableMetadata/ViewMetadata because they define inherentproperties(). If reused for types without such a method, it’ll recurse. Add a doc comment and constrain usage via a private helper trait implemented only for the intended types.Example:
pub(crate) trait HasInherentProperties { fn __seal(); } impl HasInherentProperties for TableMetadata { fn __seal() {} } impl HasInherentProperties for ViewMetadata { fn __seal() {} } // then bound the macro impls with `impl MetadataProperties for $ty where $ty: HasInherentProperties { ... }`Also applies to: 82-83
crates/lakekeeper/src/implementations/postgres/tasks/resolve_tasks.rs (3)
65-72: Make SQLx decode type for entity_name explicit.Relying on inference for TEXT[] → Vec can drift with schema changes. Annotate both selects to harden compile-time checks.
- entity_name as "entity_name!", + entity_name as "entity_name!: Vec<String>",Apply in both SELECT blocks (active_tasks and historical_tasks).
Also applies to: 75-82
83-86: Avoid ephemeral Vec slice to pass task IDs.Minor allocation/readability improvement: bind a local Vec and pass a slice.
- &task_ids.iter().map(|id| **id).collect::<Vec<_>>()[..], + { + let task_ids_uuid: Vec<uuid::Uuid> = + task_ids.iter().map(|id| **id).collect(); + &task_ids_uuid[..] + },
252-255: DRY test helper to map Vec → HashMap.This repeated pattern in tests can be a small helper to reduce noise.
fn tasks_to_map(v: Vec<ResolvedTask>) -> HashMap<TaskId, (TaskEntityNamed, TaskQueueName)> { v.into_iter().map(|t| (t.task_id, (t.entity, t.queue_name))).collect() }Also applies to: 345-348, 442-445, 503-506, 561-564, 619-622, 679-681, 749-751
crates/lakekeeper/src/server/views/drop.rs (1)
42-49: Use active-only filter for authorization lookup.Drop paths typically target active objects. Using
TabularListFlags::active()avoids surprising behavior when a view is already deleted/staged.- let view_info = C::get_view_info( + let view_info = C::get_view_info( warehouse_id, view.clone(), - TabularListFlags::all(), + TabularListFlags::active(), state.v1_state.catalog.clone(), )crates/lakekeeper/src/api/management/v1/tasks.rs (2)
79-94: task_entity(): consider fallback/error semantics on ident parse.Failing on
build_tabular_ident_from_vec(&self.entity_name)turns corrupted name parts into a hard error for get/details authz. If your authorizer checks only IDs (as OpenFGA impl does), you could:
- Map parse errors to a sanitized 500 (internal data corruption), or
- Fall back to ID-only checks by constructing a minimal Named entity with a placeholder ident.
Current approach is acceptable; consider adding a metrics counter/log to spot DB data issues.
508-590: authorize_list_tasks(): robust warehouse gating and entity-scoped checks.
- Good: refuse broad listing without CanListEverything and without
entities.- Good: Resolve tabulars via IDs and map missing to
AuthZCannotSee*.- Small nit:
map_err(RequireTableActionError::from)reads table-centric; consider a neutral error wrapper for mixed table/view fetch failures.crates/lakekeeper/src/service/authz/mod.rs (1)
421-451: Default batch implementations: consider heterogenous slices ergonomics.
&[(&impl AuthZTableInfo, _)]requires a uniform underlying type T per slice. If callers need heterogenous collections of types implementingAuthZ*Info, consider switching the parameter to&[(&dyn AuthZTableInfo, _)]. This is optional since your current call sites seem homogeneous.Also applies to: 455-481
crates/lakekeeper/src/server/views/commit.rs (3)
169-180: Commit flow ordering is correct; minor perf/log nit.
- Write new metadata file before DB commit, then commit, then clean up old location if needed — correct for consistency.
- You compute codec twice (from properties, then from metadata). Cache it once.
- let metadata_location = ctx.storage_profile.default_metadata_location( - &new_location, - &CompressionCodec::try_from_properties(new_metadata.properties())?, + let codec = CompressionCodec::try_from_properties(new_metadata.properties())?; + let metadata_location = ctx.storage_profile.default_metadata_location( + &new_location, + &codec, Uuid::now_v7(), extract_count_from_metadata_location(&previous_metadata_location).map_or(0, |v| v + 1), ); ... - write_file(&file_io, &new_view.metadata_location, &new_metadata, - CompressionCodec::try_from_metadata(&new_metadata)?).await?; + write_file(&file_io, &new_view.metadata_location, &new_metadata, codec).await?;Also applies to: 188-203, 242-249, 271-286
360-366: Error code label mismatch for SetProperties.The error kind is labeled "AddSchemaError" while setting properties. Rename for clarity.
- })?, + })?,And adjust the type string:
- "AddSchemaError", + "SetPropertiesError",
352-355: UpgradeFormatVersion branch is a no-op.Explicitly documenting unsupported versions (and returning a 400 if received) could help future-proofing once new versions appear. Optional.
crates/lakekeeper/src/implementations/postgres/tabular/view/load.rs (1)
313-319: Validate equal lengths in zips (log, properties) or handle mismatches.Add a quick length check (warn + truncate, or error) so ARRAY_AGG order/size issues are caught early instead of silently truncating via zip.
Also applies to: 326-330
crates/lakekeeper/src/implementations/postgres/namespace.rs (2)
52-79: Preferfetch_optionalto simplify RowNotFound handlingUsing
fetch_optionalavoids the manualmatchand reduces error surface. Suggested change for both functions:- .fetch_one(connection) - .await; - - let row = match row { - Ok(r) => r, - Err(sqlx::Error::RowNotFound) => { - return Ok(None); - } - Err(e) => { - return Err(e.into_catalog_backend_error().into()); - } - }; + .fetch_optional(connection) + .await + .map_err(|e| e.into_catalog_backend_error())?; + + let Some(row) = row else { return Ok(None); };Repeat the same pattern in
get_namespace_by_name. This keeps not-found asOk(None)and centralizes unexpected errors.Also applies to: 104-131
539-553: Tightenparse_namespace_identifier_from_vecparameter type
Option<impl Into<NamespaceId>>adds indirection with limited benefit at call sites (all passSome(id)). UsingOption<NamespaceId>is clearer and avoids inference surprises.-pub(super) fn parse_namespace_identifier_from_vec( +pub(super) fn parse_namespace_identifier_from_vec( namespace: &[String], warehouse_id: WarehouseId, - namespace_id: Option<impl Into<NamespaceId>>, + namespace_id: Option<NamespaceId>, ) -> std::result::Result<NamespaceIdent, InvalidNamespaceIdentifier> { - let namespace_id = namespace_id.map(Into::into); + let namespace_id = namespace_id; … }No behavior change; improves readability and type clarity.
crates/lakekeeper/src/implementations/postgres/tabular/view/mod.rs (2)
276-300: Add context to DB error when insertingview_versionWrap the backend error with detail to aid debugging.
- .await.map_err(|e| { - e.into_catalog_backend_error() - })?; + .await + .map_err(|e| { + e.into_catalog_backend_error() + .append_detail("Error inserting view_version row.") + })?;This mirrors the helpful context you add elsewhere (e.g., representation/properties).
272-275: Normalize emptydefault_catalogto NULLEngines sometimes send empty strings for optional fields. Treat
""asNULL(like you already do fordefault_namespace_id) to avoid storing meaningless values.- let default_catalog = view_version.default_catalog(); + let default_catalog = match view_version.default_catalog() { + Some(s) if s.is_empty() => None, + other => other, + };Adjust the query bind accordingly (works with
Option<&str>).crates/lakekeeper/src/server/tables.rs (4)
119-131: Build outputs fromtable_infoswithout extra temporariesMinor clarity: construct
identifiersandprotection_statusvia map/collect to avoid manual push loops.- let mut identifiers = Vec::with_capacity(table_infos.len()); - let mut protection_status = Vec::with_capacity(table_infos.len()); - for table_info in table_infos { - identifiers.push(table_info.tabular.tabular_ident); - protection_status.push(table_info.tabular.protected); - } + let (identifiers, protection_status): (Vec<_>, Vec<_>) = table_infos + .into_iter() + .map(|ti| (ti.tabular.tabular_ident, ti.tabular.protected)) + .unzip();Tiny readability win; no behavior change.
745-784: Authorization helper: keep originaltablein 403 path without extra clone
tableis cloned for the 403 case. You can avoid the clone by moving theinto()later.- let table = table.into(); - let table_infos = C::get_table_info(warehouse_id, table.clone(), list_flags, state) + let table_infos = C::get_table_info(warehouse_id, table.into(), list_flags, state) .await .map_err(RequireTableActionError::from)? - .ok_or_else(|| AuthZCannotSeeTable::new(warehouse_id, table.clone()))?; + .ok_or_else(|| AuthZCannotSeeTable::new(warehouse_id, /* re-use original ident/id here */))?;If you keep needing the original after
.into(), consider takinguser_provided: impl Into<TableIdentOrId> + Clone(mirrors patterns used in namespace/view authz).
950-993: Preserve order/avoid extra clone when resolving table infos
identifiersis aHashSet<&TableIdent>, then cloned toVec. If request order matters downstream (hooks/logging), collect directly to aVec<&TableIdent>first and use it for both catalog call and the later membership check (with aHashSetbuilt only for the containment test).No behavior change; fewer copies and clearer intent.
1533-1539: Property parsing: consider centralizing allowlistThe write-metadata allowlist is currently inline. Extract it to a small constant slice to keep the rule centralized and reduce string duplication.
+const ALLOWED_WRITE_METADATA_PROPS: &[&str] = &[ + PROPERTY_METADATA_PREVIOUS_VERSIONS_MAX, + PROPERTY_METADATA_DELETE_AFTER_COMMIT_ENABLED, + PROPERTY_METADATA_COMPRESSION_CODEC, +]; … - if ((prop.starts_with("write.metadata") - && ![ - PROPERTY_METADATA_PREVIOUS_VERSIONS_MAX, - PROPERTY_METADATA_DELETE_AFTER_COMMIT_ENABLED, - PROPERTY_METADATA_COMPRESSION_CODEC, - ] - .contains(&prop.as_str())) + if ((prop.starts_with("write.metadata") + && !ALLOWED_WRITE_METADATA_PROPS.contains(&prop.as_str())) || prop.starts_with("write.data.path"))Easier to extend later and reuse in tests.
crates/lakekeeper/src/implementations/postgres/tabular/mod.rs (4)
313-325: get_partial_fs_locations: dedupe and preserve order.If
partial_locations()yields duplicates, theANY($2)check may do extra work. Consider.collect::<HashSet<_>>()then sort for stable plans.- location - .partial_locations() - .into_iter() - // Keep only the last part of the location - .map(|l| { - let location = Location::from_str(l)?; - Ok(location.authority_and_path().to_string()) - }) - .collect() + let mut parts: Vec<String> = location + .partial_locations() + .into_iter() + .map(|l| Ok(Location::from_str(l)?.authority_and_path().to_string())) + .collect::<Result<_, InternalParseLocationError>>()?; + parts.sort(); + parts.dedup(); + Ok(parts)
83-126: DRY up TabularRow → ViewOrTableInfo mappings.Three places reconstruct identical structs. Extract a helper or
TryFrom<TabularRow>to reduce drift.I can open a follow-up to introduce
impl TryFrom<(TabularRow, WarehouseId)> for ViewOrTableInfoand reuse it here and in search mapping.Also applies to: 443-492, 601-664
532-576: Indexes for list/search hot paths.Queries filter/sort by
(warehouse_id, status, deleted_at, metadata_location, created_at, tabular_id)and search distance. Add/confirm:
- tabular (warehouse_id, deleted_at, metadata_location) INCLUDE (typ, updated_at, protected, fs_protocol, fs_location)
- tabular (warehouse_id, namespace_id, name, typ)
- tabular (warehouse_id, created_at, tabular_id)
- GIN/ivfflat index to support
concat_namespace_name_tabular_name(...) <-> $2as used by pgvector.If already present in migrations, ignore. Otherwise, I can draft the migration.
Also applies to: 666-754
1189-1216: Debug log after drop: include tabular type.Minor: add
typto the debug output to ease incident triage.- tracing::debug!( - "Dropped Tabular with ID {tabular_id}. Protected: {}, Location: {:?}, Protocol: {:?}", - location.protected, - location.fs_location, - location.fs_protocol - ); + tracing::debug!( + "Dropped {} with ID {tabular_id}. Protected: {}, Location: {:?}, Protocol: {:?}", + TabularType::from(tabular_id), + location.protected, + location.fs_location, + location.fs_protocol + );crates/lakekeeper/src/implementations/postgres/catalog.rs (1)
176-184: drop_tabular_impl omits metadata precondition.Call site passes
Noneforrequired_metadata_location, allowing deletion even if the client raced with a newer commit. If the public API expects concurrency protection, plumb the optional precondition through.Propagate an optional precondition from the API layer, defaulting to current behavior if not provided.
crates/lakekeeper/src/implementations/postgres/tabular/table/common.rs (3)
332-347: Sequence generation: avoid allocating Vec from Range when not needed.You create
seq.collect::<Vec<_>>()only for ordering. You can generate sequence on the SQL side withWITH ord AS (SELECT generate_series(1, $N) AS seq)to reduce allocations, or keep as-is if simplicity preferred.I can provide a SQL variant using
generate_seriesif you want to drop the extra vector.
602-631: Properties update: consider partial update semantics.
WITH drop AS (DELETE ...)then reinsert replaces all properties. If callers sometimes send partial updates, consider a merge/upsert path or an explicit “replace” vs “patch” flag at API level.If “replace” is intended, add a brief comment clarifying the behavior to future readers.
770-813: Encryption keys: large JSON and BYTEA arrays—ensurework_memand batch sizes.For very large key sets, UNNEST on huge arrays can stress memory. Consider chunking inserts for safety or capping batch size.
I can add a small helper to batch UNNEST inserts by N items.
crates/lakekeeper/src/service/catalog_store.rs (1)
532-538: Param name drift (cosmetic).
cancel_scheduled_tasks_implusescancel_running_and_should_stophere,forcein the impl. Types match; consider harmonizing names to reduce confusion.Rename param in the impl to match the trait for readability.
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
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/implementations/postgres/tabular/view/load.rs (1)
135-140: Non-nullable fields from LEFT JOIN will cause runtime errors.Several fields are marked as non-nullable (using
!in the SQL query and non-Optiontypes in the struct) but originate from a LEFT JOIN onview_versionthat can return NULL when no versions exist:
version_ids(line 135, struct line 392)version_default_namespace_ids(line 138, struct line 395)version_default_catalogs(line 139, struct line 396)If a view has no versions (possibly an invalid state, but defensively handleable), sqlx will fail to decode these NULL values into non-optional types.
Apply this diff to make these fields optional and handle the None case:
- vvr.version_ids as "version_ids!: Vec<ViewVersionId>", + vvr.version_ids as "version_ids: Vec<ViewVersionId>", vvr.version_schema_ids, vvr.version_timestamps, - vvr.version_default_namespace_ids AS "version_default_namespace_ids!: Vec<Option<Uuid>>", - vvr.version_default_catalogs AS "version_default_catalogs!: Vec<Option<String>>", + vvr.version_default_namespace_ids AS "version_default_namespace_ids: Vec<Option<Uuid>>", + vvr.version_default_catalogs AS "version_default_catalogs: Vec<Option<String>>",And update the struct definitions:
- version_ids: Vec<ViewVersionId>, + version_ids: Option<Vec<ViewVersionId>>, version_schema_ids: Option<Vec<i32>>, version_timestamps: Option<Vec<chrono::DateTime<Utc>>>, - version_default_namespace_ids: Vec<Option<Uuid>>, - version_default_catalogs: Vec<Option<String>>, + version_default_namespace_ids: Option<Vec<Option<Uuid>>>, + version_default_catalogs: Option<Vec<Option<String>>>,Then in
prepare_versions(around line 220), add validation for these fields similar to the existing checks.Also applies to: 392-396
crates/lakekeeper/src/implementations/postgres/tabular/table/create.rs (1)
166-201: CRITICAL: Staged views can still be deleted when creating tables. Add type filter.This DELETE query at line 177 does not filter by
typ, so creating a table will incorrectly delete any staged view (or other tabular type) with the same warehouse_id, namespace_id, and name. Unlike the deletion query inmod.rs:1158which includesAND typ = $3, this query has no type restriction.Apply this fix:
async fn maybe_delete_staged_tabular( warehouse_id: WarehouseId, namespace_id: NamespaceId, transaction: &mut Transaction<'_, Postgres>, - name: &String, + name: &str, // Returns the staged table id if it was deleted ) -> Result<Option<StagedTableId>, CatalogBackendError> { // we delete any staged table which has the same namespace + name // staged tables do not have a metadata_location and can be overwritten let staged_tabular_id = sqlx::query!( r#"DELETE FROM tabular t - WHERE t.warehouse_id = $3 AND t.namespace_id = $1 AND t.name = $2 AND t.metadata_location IS NULL + WHERE t.warehouse_id = $3 AND t.namespace_id = $1 AND t.name = $2 AND t.metadata_location IS NULL AND t.typ = $4 RETURNING t.tabular_id "#, *namespace_id, name, *warehouse_id, + TabularType::Table as _, )Additional issues to address:
- Line 170:
name: &Stringshould bename: &strfor idiomatic Rust- Function name and behavior should be consistent (currently named
maybe_delete_staged_tabularbut only deletes tables)
♻️ Duplicate comments (1)
crates/lakekeeper/src/implementations/postgres/tabular/view/load.rs (1)
370-372: Typo in log message: "efault" should be "Default".The log message has a typo: "efault namespace id" should be "Default namespace id".
Apply this diff:
tracing::warn!( - "efault namespace id '{default_namespace}' not found; returning empty default namespace." + "Default namespace id '{default_namespace}' not found; returning empty default namespace." );
🧹 Nitpick comments (3)
crates/io/src/s3/s3_location.rs (1)
64-68: Consider adding documentation for this public API method.The method name clearly indicates it normalizes the scheme to "s3", but adding a doc comment would help users understand when to use this (e.g., to normalize s3a/s3n variants) and clarify that it bypasses validation since it uses
set_scheme_unchecked_mut.Example documentation:
/// Normalizes the S3 location scheme to the canonical "s3://" scheme. /// /// This is useful for normalizing variant schemes (`s3a://`, `s3n://`) /// to the standard `s3://` scheme for consistent internal representation. /// /// # Example /// ``` /// let loc = S3Location::try_from_str("s3a://bucket/key", true).unwrap(); /// let normalized = loc.set_s3_scheme(); /// assert_eq!(normalized.scheme(), "s3"); /// ``` #[must_use] pub fn set_s3_scheme(mut self) -> Self { self.location.set_scheme_unchecked_mut("s3"); self }crates/lakekeeper/src/implementations/postgres/tabular/view/load.rs (1)
355-356: Replace.unwrap()with.expect()for better panic message.The
.unwrap()in theLazyLockinitialization could panic if the JSON deserialization fails. While deserializing an empty array is unlikely to fail, using.expect()with a descriptive message will make debugging easier if it does.Apply this diff:
static EMPTY_NAMESPACE_IDENT: LazyLock<NamespaceIdent> = - LazyLock::new(|| serde_json::from_value(serde_json::Value::Array(vec![])).unwrap()); + LazyLock::new(|| { + serde_json::from_value(serde_json::Value::Array(vec![])) + .expect("Failed to deserialize empty NamespaceIdent from empty JSON array") + });crates/lakekeeper/src/server/s3_signer/sign.rs (1)
428-428: Fix formatting: add space before opening brace.Missing space between closing parenthesis and opening brace.
Apply this diff:
- if info.is_none(){ + if info.is_none() {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
.sqlx/query-638a2340e3ecd4eca0aeae4ffc756de70680efbf063688c1f34b835c781f518d.jsonis excluded by!.sqlx/**.sqlx/query-c3d504db2b139d6f6cbd1802987414791825a842cf6cbdc26e0dbf1a2467eb64.jsonis excluded by!.sqlx/**
📒 Files selected for processing (8)
crates/io/src/s3/s3_location.rs(1 hunks)crates/lakekeeper/src/implementations/postgres/tabular/mod.rs(39 hunks)crates/lakekeeper/src/implementations/postgres/tabular/table/commit.rs(25 hunks)crates/lakekeeper/src/implementations/postgres/tabular/table/create.rs(7 hunks)crates/lakekeeper/src/implementations/postgres/tabular/view/load.rs(16 hunks)crates/lakekeeper/src/server/s3_signer/sign.rs(9 hunks)crates/lakekeeper/src/service/authz/table.rs(1 hunks)crates/lakekeeper/src/service/authz/view.rs(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-25T06:54:15.179Z
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.179Z
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/tabular/mod.rs
⏰ 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). (7)
- GitHub Check: docker / docker
- GitHub Check: sqlx-check
- GitHub Check: test
- GitHub Check: clippy
- GitHub Check: check-generated-openapi-matches
- GitHub Check: docker / docker
- GitHub Check: openfga
🔇 Additional comments (32)
crates/io/src/s3/s3_location.rs (1)
70-73: LGTM!Clean getter method that exposes the location's scheme. The
#[must_use]annotation is appropriate.crates/lakekeeper/src/server/s3_signer/sign.rs (4)
8-30: LGTM! Imports align with the new abstractions.The updated imports correctly reflect the refactored authorization and catalog types introduced in this PR.
58-221: LGTM! Authorization flow correctly implements the new abstractions.The refactored authorization logic properly uses warehouse-level checks (
require_warehouse_use) followed by table-specific authorization (require_table_action). The parallel execution usingtokio::join!is a good optimization.
438-475: LGTM! Location-based validation is more robust.The updated
validate_urifunction correctly handles boths3://and HTTPS-style S3 locations through normalization, improving the robustness of URI validation.
867-893: LGTM! Tests correctly updated for Location-based API.The test changes properly use
Location::from_strto construct locations and pass the correct types tovalidate_uri, ensuring compatibility with the refactored API.crates/lakekeeper/src/implementations/postgres/tabular/table/create.rs (5)
8-26: LGTM! Imports align with new abstractions.The updated imports correctly reflect the refactored error handling types and new table/view operation abstractions introduced in this PR.
29-44: Verify the renamedmaybe_delete_staged_tabularfunction.The function signature and early logic look correct. However, ensure that the renamed
maybe_delete_staged_tabularfunction (called at line 44) properly filters by table type to avoid deleting staged views when creating tables.I'll verify this in my review of the function implementation below.
46-63: LGTM! Proper type conversion with error handling.The conversion from
tabular_infotoTableInfoviainto_table_info()with appropriate error handling for unexpected types is well-implemented.
64-162: LGTM! Consistent table_id usage across operations.The migration from
tabular_idtotable_idis consistently applied across all insert and set operations. The addition of encryption keys insertion improves completeness.
203-245: LGTM! Correct migration to table_id with improved error handling.The function signature and implementation correctly use
TableIdinstead of the generic tabular identifier, and error handling has been properly updated to use the newInternalBackendErrorstype.crates/lakekeeper/src/implementations/postgres/tabular/table/commit.rs (7)
28-35: LGTM: Error conversion implementation is correct.The From implementation properly maps both FromTabularRowError variants into their respective CommitTableTransactionError types.
50-75: LGTM: Location parsing properly gates invalid input.Parsing the location from metadata early in the pipeline ensures that malformed locations fail fast before any database operations, which is the correct approach.
110-132: LGTM: Result validation correctly enforces table-only responses.The code properly validates that only tables are returned from table commits, returning a descriptive error if a view is unexpectedly present.
207-218: LGTM: Location components extraction and integer conversion are correct.The code properly extracts filesystem protocol and location components, and the
next_row_idconversion includes helpful error context when the value exceeds i64::MAX.
265-278: LGTM: RETURNING clause correctly matches TabularRow fields.The query returns all necessary fields to construct TabularRow instances, maintaining consistency with other tabular queries in the codebase.
308-320: LGTM: Commit count validation correctly addresses previous review feedback.The implementation now properly accounts for both the table query (8 binds) and tabular query (6 binds), using the more restrictive limit to prevent parameter overflow. This correctly resolves the issue raised in the previous review.
585-780: LGTM: Test coverage validates new TableInfo return behavior.The test scaffolding properly validates that
commit_table_transactionnow returns updatedTableInfoobjects, and verifies that the committed metadata can be correctly loaded back from the database.crates/lakekeeper/src/implementations/postgres/tabular/mod.rs (12)
51-64: LGTM: Error type definitions and conversions are well-structured.The
FromTabularRowErrorenum properly unifies row-parsing errors, and theFromimplementation correctly maps each variant to the corresponding domain error type.
66-128: LGTM: TabularRow conversion logic properly handles both tables and views.The
try_into_table_or_viewmethod correctly parses locations and namespace identifiers, then constructs the appropriateViewOrTableInfovariant based on the tabular type.
130-203: LGTM: Bulk tabular lookup correctly handles mixed table/view queries.The function efficiently queries multiple tabulars using parallel arrays for IDs and types, and properly converts the results into the unified
ViewOrTableInfotype.
313-325: LGTM: Partial location extraction properly handles parsing errors.The function correctly iterates through partial locations and extracts their authority and path components, with appropriate error propagation.
336-420: LGTM: Tabular creation properly handles conflicts and returns rich info.The function correctly creates tabulars, handles unique constraint violations by returning
TabularAlreadyExists, checks for location conflicts, and returns the newly createdViewOrTableInfo.
422-492: LGTM: Deletion info conversion properly reuses base TabularRow logic.The function efficiently reuses the base
TabularRowconversion and correctly constructs deletion-specific information including optional expiration task details.
601-664: LGTM: Search result conversion maintains consistency with other row conversions.The
PostgresSearchTabularInfostruct and its conversion method follow the same pattern asTabularRow, correctly including the search-specificdistancefield in the final result.
1028-1034: LGTM: Missing-id detection correctly addresses previous review feedback.The code now properly dereferences
&TabularIdto&Uuidusing&**idwhen checking against theHashSet<Uuid>, which resolves the type mismatch issue raised in the previous review. The error construction using*missing_idis also correct.
767-928: LGTM: Rename operation properly handles both same-namespace and cross-namespace moves.The function correctly handles two distinct rename paths with appropriate locking and conflict detection, returning the updated
ViewOrTableInfoin both cases.
964-1044: LGTM: Clear deleted-at operation correctly handles mixed table/view inputs.The function properly converts
TabularIdtoUuidfor the query, handles unique constraint violations appropriately, and returns detailed deletion information for each tabular.
1055-1138: LGTM: Mark-as-deleted operation correctly validates protection status.The function properly handles the deletion flow with appropriate locking, validates the protection flag, and returns the marked tabular's information as
ViewOrTableInfo.
1140-1214: LGTM: Drop operation correctly returns location and validates concurrent updates.The function appropriately returns the tabular's
Location(rather than info about the deleted entity), and properly implements optimistic concurrency control through the optional metadata location check.crates/lakekeeper/src/service/authz/view.rs (1)
87-94: Past issue resolved: error message now correctly references "view".The previous review comment about the error message incorrectly saying "namespace" has been addressed. The message now correctly states the action is forbidden "on view {view}".
crates/lakekeeper/src/service/authz/table.rs (2)
288-343: LGTM: Well-designed batch authorization with proper deduplication.The
require_table_actionsmethod correctly deduplicates actions per table, ensuresCAN_SEE_PERMISSIONis checked first for each table, and provides precise error reporting. The use ofHashMapfor aggregation anditertools::chainfor ordering is appropriate.
414-496: LGTM: Correct partition-and-reorder logic for mixed table/view operations.The
are_allowed_tabular_actions_vecmethod properly partitions mixed actions, authorizes each type separately, validates result counts, and reconstructs the original order. The debug assertions provide good safety checks.
✅ Actions performedComments resolved and changes approved. |
1 similar comment
✅ Actions performedComments resolved and changes approved. |
✅ 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
New Features
Refactor
API Changes