Repository navigation
fix(vdb): keep LanceDB stream input errors and clean up files from failed worker commits - #2830
Conversation
…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.
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
[Medium impact] The PR appears safe to merge; no new actionable issues were found. SummaryThis PR preserves input errors during streamed LanceDB writes and removes files moved by failed worker commits.
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.
|
…hen cleanup fails
Refresh streaming write validation against the current release baseline.
|
Superseded by #2861, which batches the release fixes into one PR, one commit per original PR. This change is commit-for-commit identical there. |
|
Reopened: keeping the release fixes as individual PRs for review. #2861 is closed. |
Description
Fixes two LanceDB write-path bugs that Devin Review found after #2785 merged. Each one has a regression test that fails on
mainand passes with this change.RuntimeError: Arrow error: C Data interface error: .... This covers aVdbUploadError(searchable rows without embeddings), anOversizedVdbRowError, and anon_bad_vectors="error"vector error._mutate_stream_datanow records the input'sValueErrorand re-raises it, chained to LanceDB's error. The existing commit-outcome checks (CommitOutcomeUnknown,DataCommittedFinalizationError) still run first. This also happened onmainbefore perf(vdb): worker-native LanceDB sink: Ray Data writer actors write Lance fragments, the driver commits once #2785.<table>.lance/datastay 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), theworker_writedocstring, and the matching paragraph invdbs.md.Unchanged: receipts, the
VDBcontract, the executor/operator code, service-table maintenance, and streamoptimize().Reviewed but not changed:
chunks.lance/datafolder (onmainbefore perf(vdb): worker-native LanceDB sink: Ray Data writer actors write Lance fragments, the driver commits once #2785 too), and the retry creates the table normally.fresh_table.optimize()in stream finalize: runs only whenstream_optimize=True, which defaults toFalseand has no caller in the library. Also onmainbefore perf(vdb): worker-native LanceDB sink: Ray Data writer actors write Lance fragments, the driver commits once #2785.Tests:
test_lancedb_*.py+test_bounded_vdb_sink.py: 210 passed. The new failure-path tests fail onmain. 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
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