Skip to content

fix(vdb): keep LanceDB stream input errors and clean up files from failed worker commits - #2830

Merged
jperez999 merged 5 commits into
mainfrom
devin/1793809427-lancedb-stream-fixes
Nov 17, 2026
Merged

jperez999 merged 5 commits into
mainfrom
devin/1793809427-lancedb-stream-fixes

Conversation

@jioffe502

@jioffe502 jioffe502 commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Fixes two LanceDB write-path bugs that Devin Review found after #2785 merged. Each one has a regression test that fails on main and passes with this change.

  • Input errors lose their type (driver stream). If the input fails after the first Arrow batch has reached LanceDB, LanceDB's reader rewraps the error, so the caller gets RuntimeError: Arrow error: C Data interface error: .... This covers a VdbUploadError (searchable rows without embeddings), an OversizedVdbRowError, and an on_bad_vectors="error" vector error. _mutate_stream_data now records the input's ValueError and re-raises it, chained to LanceDB's error. The existing commit-outcome checks (CommitOutcomeUnknown, DataCommittedFinalizationError) still run first. This also happened on main before perf(vdb): worker-native LanceDB sink: Ray Data writer actors write Lance fragments, the driver commits once #2785.
  • Failed worker commits leave orphan files. When moving the files or the Lance commit fails, the data files already moved into <table>.lance/data stay there. Now they are deleted, but only if the table is still at the version the write started from. If the table version changed (the commit may have landed, or another writer overwrote it), or the table can't be read, the files are kept, so a version that is still retained never loses files it needs. A file that can't be deleted is logged, and the original commit error is still raised.

Scope: lancedb.py (_mutate_stream_data, _commit_worker_fragments, new _discard_uncommitted_files), the worker_write docstring, and the matching paragraph in vdbs.md.

Unchanged: receipts, the VDB contract, the executor/operator code, service-table maintenance, and stream optimize().

Reviewed but not changed:

Tests: test_lancedb_*.py + test_bounded_vdb_sink.py: 210 passed. The new failure-path tests fail on main. Two more tests pass on both and guard the keep-files cases: the commit lands and then raises, and another client overwrites the table after the commit. pre-commit is clean.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Link to Devin session: https://nvidia-cloud.devinenterprise.com/sessions/5abc044c7f91478083058274e43a613d
Open in Devin Desktop: https://nvidia-cloud.devinenterprise.com/desktop/session/5abc044c7f91478083058274e43a613d?variant=devin
Requested by: @jioffe502


Devin Review

…orker commits

The driver stream re-raises the input's own exception (e.g. VdbUploadError) instead of LanceDB's generic RuntimeError. A failed worker commit deletes the data files it moved while the table is still at its starting version.
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

devin-ai-integration[bot]

This comment was marked as resolved.

@greptile-apps

greptile-apps Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

This PR preserves input errors during streamed LanceDB writes and removes files moved by failed worker commits.

  • Streaming writes keep the original input error type.
  • Failed worker commits remove files only when the table stays unchanged.

Review used the full PR changes because the current and previously reviewed commits have different merge bases with the target commit. Tests were inspected, not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Worker commit fails] --> B{Can the table be read?}
    B -->|No| C[Keep moved files]
    B -->|Yes| D{Version unchanged?}
    D -->|No| C
    D -->|Yes| E[Delete moved files]
    E --> F[Log any deletion failures]
    C --> G[Raise original commit error]
    F --> G
Loading

Reviews (5) · Last reviewed commit: "Merge main into LanceDB streaming fixes" · Reviewed by Greptile

greptile-apps[bot]

This comment was marked as resolved.

greptile-apps[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration 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.

Devin Review found 1 new potential issue.

Devin Review

Refresh streaming write validation against the current release baseline.
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Superseded by #2861, which batches the release fixes into one PR, one commit per original PR. This change is commit-for-commit identical there.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Reopened: keeping the release fixes as individual PRs for review. #2861 is closed.

@jperez999
jperez999 merged commit ebdff2c into main Nov 17, 2026
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants