Commit Graph
5 Commits
Author SHA1 Message Date
Xuanwo 08a286edb3 feat: add resumable staged table writes (#5358)
A coordinator can publish batches staged by multiple ingest workers in a
single table version. This adds staged append and overwrite in LanceDB
Embedded and Enterprise across Rust, synchronous and asynchronous
Python, and TypeScript. Ordinary `table.add()` continues to commit
immediately.

A coordinator selects the mode with `begin_write(mode)` (`beginWrite` in
TypeScript) and shares the opaque write ID. Workers open the same
writable table and branch and resume with `open_write(id)` (`openWrite`
in TypeScript). They can retry the same input with the same idempotency
key. Staging returns no version. Explicit `commit()` publishes one
version and returns `AddResult`. Explicit `abort()` discards the staged
write and can be repeated. Dropping a handle performs no I/O.

Enterprise uses the existing multipart endpoints on servers with
multipart write support. A non-empty staged overwrite input carrying
top-level Arrow schema metadata fails before the SDK sends any part
insert. The SDK enforces this in Rust `StagedWrite::add(...).execute()`,
Python `StagedWrite.add` and `AsyncStagedWrite.add`, and TypeScript
`StagedWrite.add` on every supported Enterprise server version. Empty
input is a no-op. Staged append and overwrite with an empty top-level
map are supported, including field and nested field metadata on
overwrite. [OSS-2859](https://linear.app/lancedb/issue/OSS-2859) ·
[Distributed reads in OSS-441](https://linear.app/lancedb/issue/OSS-441)

The separate Sophon fix preserves top-level schema metadata in the
server’s multipart overwrite path. The SDK follow-up verifies a route
that sends every part, retry, and completion to fixed instances before
lifting the guard.
[ENT-4970](https://linear.app/lancedb/issue/ENT-4970/multipart-overwrite-drops-top-level-schema-metadata-in-sophon)
· [Sophon #11472](https://github.com/lancedb/sophon/pull/11472) ·
[OSS-3312](https://linear.app/lancedb/issue/OSS-3312/enable-schema-metadata-in-enterprise-staged-overwrite-after-verifying)

Embedded staged overwrites keep top-level, field, and nested-field
metadata from the replacement schema. Commit rejects overwrite parts
whose restored schemas differ. The Insert data guide shows staged writes
in Python, TypeScript, and Rust. The Distributed Write guide describes
both SDK-coordinated staging and server-coordinated CTAS.

## Validation

Final head `cf6737cece7b17f33a13556ba13f1460a0d4cfc8` adds the guard in
`a02beb97084cb9d5d70b0bfdbbf31ce7bb4b1067` and a documentation-only
commit.

- **Rust.** All 14 `--lib staged_write` tests and all 15 `--lib
multipart_write` tests passed with the locked `ci` profile and
Enterprise support.
`explicit_enterprise_overwrite_rejects_schema_metadata_before_upload`
covers rejection before insert, known and streaming empty inputs, and a
subsequent field-metadata part in the same session.

- **Python and Sophon 1.16.0.** The Python extension was rebuilt with
the final Rust inputs. The staged-write and permutation suites passed
133 tests with 2 skipped. On the isolated released-service fixture, sync
and async staged overwrite rejected top-level metadata with zero insert
requests. A materialized zero-row table and a streaming zero-row batch
both succeeded without an insert. A fresh read verified the original
version, row, and schema. Two independent workers then staged parts with
field and nested field metadata, and an independent coordinator
published one version with exactly the replacement rows. The reopened
SDK table and Lance manifest preserved that metadata. Ordinary overwrite
and staged append also succeeded.

- **TypeScript and docs.** TypeScript compilation, lint, TypeDoc, strict
MkDocs, and Vale passed. The final TypeScript changes are documentation.
The earlier Node native build and staged-write test below cover the
binding. The Rust tests and rebuilt Python extension exercised the final
shared guard.

At `ab9f49fba5055a5f731fe013a820515aa5cfa12c`, all 11 Rust staged-write
integration tests and 13 staged-write unit tests passed. The new tests
exercise independent reopen, reject differences at each metadata level,
and verify one publication with the complete schema after replacing the
mismatched part. Rust formatting and Vale passed for the follow-up.

On the initial validation head
`68e950d24a1418890f80eb04102de49388012318`:

- Rust passed the library check with Enterprise support and 15 existing
multipart tests.
- Python passed both staged-write tests covering synchronous
multiprocessing and asynchronous overwrite and abort. The separate
fail-loud fragment constraint regression passed all 39 cases.
[#5120](https://github.com/lancedb/lancedb/pull/5120)
- Node.js passed the native build, TypeScript compilation, lint, and the
staged-write Jest test. TypeDoc generation and strict MkDocs also
passed.

The initial Python and Node.js native extensions were built at
`47ea43533f103744e84a7cdbe83d8e4a8ddf093e` with the repository’s `ci`
profile, the default SDK features, and locked Lance 16.0.0-beta.7 and
`object_store` 0.14.2. The initial validation head differs from that
build commit only in two generated TypeDoc pages. The Python and Node.js
tests ran again at that head using the same native artifacts.

The candidate Python SDK passed multipart create, cross-process staging,
commit, and abort against released LanceDB Enterprise (Sophon) 1.16.0 on
an isolated loopback gateway and S3-compatible store. After an ordinary
append published version 2, a separate coordinator committed the staged
batches once to version 3, with exactly the three expected rows. The
probe also verified overwrite conflict handling, schema refresh after a
successful overwrite, and branch and pinned-handle behavior.

Both abort modes removed the upload marker and staged transaction
records, rejected subsequent staging and commit, and left the table at
version 3 with the same rows. Append abort removed its staged payload.
Overwrite abort left one unreferenced data file in object storage for
storage cleanup.

A separate Sophon 1.16.0 probe confirmed that multipart overwrite loses
top-level schema metadata, including `embedding_functions` and
`lancedb::column_definitions`. Field and nested-field metadata survived,
and a single-request overwrite preserved the full metadata on the same
input.

## Local security comparison

Compared head `ab9f49fba5055a5f731fe013a820515aa5cfa12c` with its merge
base `c85647526c90647d9b5d6a701afeacca3f47b34d`.

- **Dependencies.** OSV-Scanner 2.7.1 used one offline crates.io
advisory snapshot for both Cargo locks. Each scan read 1,098 package
entries and reported the same 48 advisory matches across 24 package
versions. The change makes the already-locked `prost` 0.14.4 a direct
dependency for Embedded, where Lance already pulls it in. OSV and the
GitHub Advisory Database returned no advisory for that version. The
Cargo, Python, and Node lockfiles are byte-identical. The latter two
therefore did not require a dependency audit.

- **Source.** Semgrep Community Edition 1.187.0 ran 658 security and
secret rules on 16 baseline files and 24 candidate files across Rust,
Python, and TypeScript. Both results contained the same 31 matches on
unchanged code, with zero skipped targets or parse errors. These were
existing Rust `unsafe` blocks in tests and N-API branch metadata, a
Python serialization check, and a TypeScript iterator call through
`Symbol.asyncIterator`. [Rule
snapshot](https://github.com/semgrep/semgrep-rules/tree/a5ad1714f00c9f7fde980cab0ea1d6dc6d414fd2)

The OSV results cover lockfile package versions in the local database.
Semgrep covers the changed source files with file-local analysis.
Rule-level Aikido results were unavailable for comparison.
2026-12-02 20:52:30 +00:00
Jack YeandClaude Sonnet 5 5e38120bdc docs: add storage integration SDK examples, abstract RTE write, simplify cache pages (#4865)
## Summary

- **Define Storage Integration**: un-gates the Python (and Rust, for S3)
`create_storage_integration` examples, drafted against #4618 and held
back until it shipped -- it's now in v0.42.0-beta.0+, and the signature
matches the drafts exactly.
- **Naming rules**: drops the `Branch` row and its "Learn more" link,
consistent with de-emphasizing branches elsewhere in this nav.
- **Distributed RTE Write**: removes the REST path, the
`__lance_mem_wal` index name, and "WAL node" terminology in favor of an
abstract framing -- a query node routes writes to RTE nodes, each of
which can host shards from many different tables. Both diagram variants
are updated to match.
- **Data Page Cache / Tiered Index Cache / Cache Prewarm**: drop
Helm-specific and exact-percentage detail (disk-budget math,
`startup_prewarm_block_query_ready`/`healthPort`/failure-policy table)
in favor of a short feature → architecture → why-it-matters shape, each
closing with a contact-sales pointer. Data Page Cache's on-demand
prewarm section is removed outright.

## Note

I wasn't able to get a clean visual render of the updated Distributed
RTE Write diagram in local preview -- Mermaid isn't rendering in
headless Chrome in this environment for *any* page right now, confirmed
against an unmodified reference page showing the identical symptom. The
diagram source follows the exact pattern already shipped and working in
the 21 diagrams from the earlier brand-theming pass, and `mint
validate`/`mint broken-links` both pass clean.

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-05 01:40:54 -08:00
Jack YeandClaude Sonnet 5 d0b0efcd47 style: increase Mermaid diagram font size and tone down dark-mode accent borders (#4828)
## Summary

Follow-up to the Mermaid brand-theming PR, addressing review feedback:

- Diagram text was hard to read at the previous 15px font size; bumped
to 18px, light and dark alike.
- The dark-mode orange accent border was brighter and more saturated
than its fill or the default border, reading as too loud against the
dark background. It now reuses the same muted orange already used for
the light-mode accent border, which was fine as is.

## Companion change

lancedb/sophon#9719 makes the same two changes across its own diagrams.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-04 20:25:14 -08:00
Jack YeandClaude Sonnet 5 dfbf682cb5 style: re-theme Mermaid diagrams to the brand palette, light and dark (#4822)
## Summary

Every Mermaid diagram now renders in the brand palette, with separate
light and dark variants that switch with the site's theme toggle.
Default node styling stays neutral; one accent color marks each
diagram's actual subject, chosen per diagram. A couple of diagrams
changed orientation where their old layout was too wide to read
comfortably.

Companion change in lancedb/sophon uses the same colors and pattern.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_018PXMCbRH6i5w47TsjeEUMT

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-03 21:02:24 -08:00
Jack YeandClaude Sonnet 5 de95ed3f6d docs: overhaul curation, feature engineering, security and deployment guides (#4748)
A broad documentation pass across the areas LanceDB Enterprise and
Embedded
diverge on most:

**Data Curation** -- GPU Function execution, Slurm scheduling (and what
Slurm is, for readers new to it), blob late materialization as its own
page, joins, aggregation/profiling, sampling, near-duplicate detection,
chunking, distributed shuffle, and IVF-partition clustering.

**Feature Engineering** -- computed columns and materialized views,
restructured to lead with the Function-based path and show the SQL form
side by side with Python throughout; a single Auto Refresh page instead
of
duplicating scheduling details on every refresh page; adaptive
execution;
checkpointing; GPU and Slurm placement for refresh workers; a Training
Cache page for the PyTorch data loader's automatic cache benefit.

**Security & Governance** -- an Audit Log reference (schema, access,
grants), Secrets promoted to an ordinary catalog object with their own
SQL
DDL and a vending/rotation guide, and privilege-table fixes verified
against the authorization source.

**Deployment & Maintenance** -- Horizontal Scaling and OpenTelemetry
moved
into a real Deployment area; Automated Cleanup folded into Intelligent
Auto-Maintenance (every other maintenance decision already lived there);
RTE Compaction and Advanced Conflict Resolution documented in depth.

**Landing page** -- the Enterprise feature comparison table reorganized
(several redundant or stale rows removed, several new areas added), and
the
"why Enterprise" bullets replaced with ones tied to a concrete page
(Performance, Scale, Fault tolerance, Multicloud deployment, Simplify
operations) instead of vague promises.

Plus a full pass addressing lancedb-gatekeeper's review: a real
test-safety
bug (a quickstart test could silently overwrite and delete a
deployment's
own `frames` table), a fabricated SQL statement with no backing
implementation, an actual dedup-guarantee bug in `take_row_ids`, and
dozens
of documentation-accuracy fixes verified against source rather than
taken
on faith -- each either fixed, or left with an explicit note on why it
needs a feature or deployment owner's sign-off instead of being guessed
at.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_018PXMCbRH6i5w47TsjeEUMT

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-03 16:17:24 -08:00