Skip to content

fix(catalog): refresh schema after table replacement - #242

Open
mikewhb wants to merge 3 commits into
lance-format:mainfrom
mikewhb:fix/dir-namespace-replace-v6
Open

fix(catalog): refresh schema after table replacement#242
mikewhb wants to merge 3 commits into
lance-format:mainfrom
mikewhb:fix/dir-namespace-replace-v6

Conversation

@mikewhb

@mikewhb mikewhb commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Preserve Lance's zero-row overwrite commit semantics for schema-only CREATE OR REPLACE TABLE operations.

After a successful overwrite, invalidate only the replaced directory dataset cache entry and evict its stale attached-catalog entry so lazy discovery reloads the committed schema. Leave cached handles and catalog state unchanged when the writer fails, and preserve cross-query reuse for untouched datasets.

Add regression coverage for schema refresh, failed replacements, precise cache invalidation, and untouched cache reuse.

Preserve Lance's zero-row overwrite commit semantics for schema-only CREATE OR REPLACE TABLE operations.

After a successful overwrite, invalidate only the replaced directory dataset cache entry and evict its stale attached-catalog entry so lazy discovery reloads the committed schema. Leave cached handles and catalog state unchanged when the writer fails, and preserve cross-query reuse for untouched datasets.

Add regression coverage for schema refresh, failed replacements, precise cache invalidation, and untouched cache reuse.
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-changes Latest Gatekeeper recommendation requests changes. label Aug 13, 2026
Use the physical identifier returned by case-insensitive namespace discovery when replacing a table. This keeps writes, cache invalidation, and catalog refresh scoped to the existing dataset instead of creating a case-variant sibling.
@lance-gatekeeper lance-gatekeeper Bot removed the K-changes Latest Gatekeeper recommendation requests changes. label Aug 13, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-changes Latest Gatekeeper recommendation requests changes. label Aug 13, 2026
Resolve directory namespace lookups through the listed table name so
case-variant replacements retain the physical dataset identifier.

Use that identifier for DROP and add replacement and drop regressions.
@lance-gatekeeper lance-gatekeeper Bot removed the K-changes Latest Gatekeeper recommendation requests changes. label Aug 13, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Gate recommendation: approve with a non-blocking risk.

The case-variant replacement and DROP paths now preserve the physical table identifier, and the prior schema-only and CTAS rediscovery failure is fixed.

The author intentionally accepts that a second DuckDB connection may continue reading a stale cached Lance dataset after another connection commits a replacement. No further change is requested for that behavior in this pull request.

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. labels Aug 13, 2026
@mikewhb

mikewhb commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

@Xuanwo Could you review fix/dir-namespace-replace-v6? It keeps directory CREATE OR REPLACE TABLE on the existing dataset (including case-insensitive names), refreshes only that table after a successful overwrite, and adds replace/DROP regressions. Thanks.

@mikewhb

mikewhb commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

@lance-community Lance Gatekeeper pipeline could not complete on the last run, could you please rerun it?

@mikewhb mikewhb closed this Aug 15, 2026
@mikewhb mikewhb reopened this Aug 15, 2026
@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. and removed K-risk Latest Gatekeeper recommendation includes a non-blocking risk. K-approved Latest Gatekeeper recommendation permits acceptance. labels Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant