Skip to content

feat: support namespace as external manifest store#5968

Merged
jackye1995 merged 23 commits intolance-format:mainfrom
jackye1995:ns-table-version-ext
Feb 20, 2026
Merged

feat: support namespace as external manifest store#5968
jackye1995 merged 23 commits intolance-format:mainfrom
jackye1995:ns-table-version-ext

Conversation

@jackye1995
Copy link
Copy Markdown
Contributor

@jackye1995 jackye1995 commented Feb 18, 2026

This PR is based on discussion in #5849

I have added 4 APIs in Lance Namespace spec:

  • ListTableVersions (this already existed, but added a flag descending to allow return versions in descending order)
  • CreateTableVersion
  • DescribeTableVersion
  • BatchDeleteTableVersions

With these APIs, we can fulfill the ExternalManfiestStore trait with a LanceNamespaceExternalManfiestStore by:

  • get: call DescribeTableVersion
  • get_latest_version: call ListTableVersions with limit=1, descending=false
  • put: call CreateTableVersion (this is a new function that combines put_if_not_exist and put_if_exists)
  • delete: call BatchDeleteTableVersions with range [0, -1)

We also added a basic implementation in DirectoryNamespace with:

  • when CreateTableVersion, just put the staged manifest to the target version
  • ListTableVersions, DescribeTableVersion, BatchDeleteTableVersions are just facade to storage level operations

In DirectoryNamespace, we added a flag table_version_tracking_enabled. When true, when user calls describe_table or declare_table to get table information, we return a new flag in response saying managed_versioning=true, indicating that the namespace should manage table version commit and resolution. Based on that information, we set the commit handler to be external manifest store commit handler, and the external manifest store to be LanceNamespaceExternalManfiestStore.

@jackye1995 jackye1995 marked this pull request as draft February 18, 2026 22:58
@github-actions github-actions Bot added enhancement New feature or request python java labels Feb 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

PR Review

P0: Build will break - Invalid dependency path

Cargo.toml:69 changes lance-namespace-reqwest-client to a local path outside the repository (../lance-namespace/rust/lance-namespace-reqwest-client). This will fail for anyone without a sibling lance-namespace directory.

P1: Race condition in create_table_version

rust/lance-namespace-impls/src/dir.rs:693-721 has a TOCTOU race condition between checking if the version exists and copying the manifest. This defeats the put_if_not_exists semantics. Consider using copy_if_not_exists or similar atomic operation.

P1: put_if_exists contradicts implementation

rust/lance/src/io/commit/namespace_manifest.rs:114-133 - The put_if_exists method calls create_table_version, but create_table_version rejects existing versions. This needs a separate update API or reconciled semantics.

Summary

  1. P0: Fix the Cargo.toml path dependency before merge
  2. P1: The race condition undermines the core feature
  3. P1: put_if_exists implementation is broken

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 19, 2026

/// implement a staging-based workflow. Implementations that can write directly
/// (e.g., namespace-backed stores) should override this method.
#[allow(clippy::too_many_arguments)]
async fn put(
Copy link
Copy Markdown
Contributor Author

@jackye1995 jackye1995 Feb 20, 2026

Choose a reason for hiding this comment

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

this is probably a good middle ground between external manifest store today vs doing a whole new manifest store. We will have a single generic put to put a manifest to the store that can be overridden. It gives more freedom compared to having to follow exactly the same flow with put_if_not_exist and then put_if_exists

@jackye1995 jackye1995 marked this pull request as ready for review February 20, 2026 08:41

@pytest.mark.skipif(
sys.platform == "win32",
reason="External manifest store has known issues on Windows",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

looks like external manifest store code path in general has compatibility issue with windows, skip related tests for now and fix in a separated PR

@jackye1995 jackye1995 merged commit 9511d6d into lance-format:main Feb 20, 2026
30 checks passed
jackye1995 added a commit to lancedb/lancedb that referenced this pull request Mar 9, 2026
Without this fix, if user directly use the native table to do operations
like `add_columns`, even if it is configured to use namespace db
connection, it is not really propagated through.

The fix is to bring lancedb's python binding up to date and do a similar
implementation as lance-format/lance#5968, and
make sure the namespace is fully propagated through all the related
calls.

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request java python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants