mirror of
https://github.com/ModernRelay/omnigraph.git
synced 2026-06-09 01:35:18 +02:00
Lance 4.0.x's MergeInsertBuilder rejects the second sequential
`update T set {f:v} where x=y` against the same row in a multi-row
table with "Ambiguous merge inserts: multiple source rows match the
same target row on (id = ...)". omnigraph passes exactly 1 source row
(verified by instrumenting `execute_update` and `MutationStaging::finalize`:
scan returns 1 row, apply_assignments returns 1 row, the batch fed to
`stage_merge_insert` has 1 row with the expected id), but Lance's
`processed_row_ids: Mutex<HashSet<u64>>` (lance-4.0.0
src/dataset/write/merge_insert.rs:2099) double-processes the same
source/target match against datasets previously rewritten by
merge_insert and trips its own dedupe guard.
Fix: opt the engine's two MergeInsertBuilder call sites
(`stage_merge_insert`, `merge_insert_batch`) into
`SourceDedupeBehavior::FirstSeen`, which silently skips duplicate
matches instead of erroring. Correctness-preserving for omnigraph
because `MutationStaging::finalize` already dedupes the source by id
before this call — there cannot be true source-side duplicates at
this layer, so FirstSeen only suppresses the spurious Lance bug.
Test `runs.rs::second_sequential_update_on_same_row_succeeds` is the
positive regression for the cross-query update path. Existing
`chained_updates_with_overlapping_predicate_respects_intermediate_value`
covers chained updates within ONE query (handled by MutationStaging's
in-memory accumulator); this new test exercises the case where each
call gets a fresh staging accumulator and re-opens the dataset at HEAD.
This is a workaround at the omnigraph layer. The right long-term fix
likely lives in Lance (hardening the merge plan against
double-processing, or making FirstSeen the default for stable-row-id
datasets) or in the storage-layer refactor (MR-793 family) where the
merge_insert primitives are scoped to the engine.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| omnigraph | ||
| omnigraph-cli | ||
| omnigraph-compiler | ||
| omnigraph-server | ||