Skip to content

fix: treat a version with no namespace record as not found - #10826

Merged
Xuanwo merged 4 commits into
lance-format:mainfrom
LuciferYang:fix/namespace-version-not-found
Nov 14, 2026
Merged

Xuanwo merged 4 commits into
lance-format:mainfrom
LuciferYang:fix/namespace-version-not-found

Conversation

@LuciferYang

@LuciferYang LuciferYang commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Closes #10824.

LanceNamespaceExternalManifestStore::get now returns Error::NotFound when the namespace reports the table, branch, or version as missing. ExternalManifestCommitHandler reads Error::NotFound from the store as "no record" in version_exists, is_manifest_path_authoritative and the object-store fallback of resolve_version_location, so cleanup now deletes a staging manifest that no namespace record points to. Other namespace errors still propagate unchanged, and get_latest_version keeps its separate chain-missing None contract.

Checking out a version the namespace has no record of now goes through the same object-store fallback as other external manifest stores, so it fails with Lance's NotFound error (ValueError in Python) instead of the namespace's TableVersionNotFound error.

How was this patch tested

test_cleanup_removes_staging_manifest_without_version_record uses a DirectoryNamespace with version tracking and injects one create_table_version failure during an append, so the staging manifest stays behind. It asserts the append fails with an unknown commit status, the loaded dataset remains at version 1, exactly one staging manifest remains, and has_successor_version is false. Cleanup with delete_unverified then removes that manifest, and count_rows(None) on the already-loaded dataset returns 3. The test covers namespace-record classification and cleanup; count_rows on that loaded handle may use manifest metadata and does not prove a fresh reopen, full scan, or data-file readability.

test_error_classification replaces test_get_latest_version_error_classification and covers both get and get_latest_version: a missing table, branch or version reads as absent, and internal, throttling and IO errors propagate with their original variant.

The branch was merged with current main and revalidated:

  • cargo test --profile ci --locked -p lance --lib io::commit::namespace_manifest::tests::test_error_classification
  • cargo test --profile ci --locked -p lance-namespace-impls --lib dir::tests::e2e_table_version_tracking::test_cleanup_removes_staging_manifest_without_version_record
  • cargo test --profile ci --locked -p lance-namespace-impls --lib 'dir::tests::e2e_table_version_tracking::' (44 passed)
  • cargo test --profile ci --locked -p lance --lib 'io::commit::external_manifest::test::' (14 passed)
  • cargo fmt --all
  • cargo clippy --profile ci --locked --all --tests --benches -- -D warnings

@claude claude 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.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@github-actions github-actions Bot added A-namespace Namespace impls bug Something isn't working labels Nov 7, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 7, 2026
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 14, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Gate recommendation: approve.

This restores cleanup after failed namespace commits while preserving operational errors. No blocking issues found.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 14, 2026
@Xuanwo
Xuanwo merged commit 9c0de40 into lance-format:main Nov 14, 2026
43 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-namespace Namespace impls breaking-change bug Something isn't working K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: cleanup fails on a namespace-managed table when a staging manifest has no version record

2 participants