UPDATE that matches no rows still commits a new version
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 53/100
Direzione di ricerca
Start in UpdateJob::commit_impl and trace how num_updated_rows and removed, updated, or new fragments determine whether a commit occurs. The issue identifies no_op_update_ignores_explicit_exact_version as an existing test; extend it or add a focused case that checks the returned dataset version when no rows match. Done means the no-op update returns the input dataset without creating a version, while updates that affect rows still commit.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
UpdateBuilder::...execute() commits a new dataset version even when the predicate matches no rows. The commit carries an Operation::Update with no removed, updated or new fragments: it changes nothing, but it still takes a manifest CAS, adds a version to the history, and conflicts with (pre-empts) concurrent writers such as compaction.
Why it matters
Conditional ("compare-and-set") UPDATEs are a common pattern for leases and fenced status writes, e.g.
UPDATE t SET owner = 'pod-a', deadline = 1234
WHERE id IN (...) AND (owner IS NULL OR deadline < now)
When several writers race for the same rows, every loser's UPDATE matches 0 rows and still commits a version. In our deployment (lance 12, GCS), a 356-file ingest burst produced 26 such zero-row Update commits on one table, alongside the real ones. Every commit of that burst pre-empted the table's compaction, so compaction never landed until the burst ended (fragments went from 40 to 384).
Reproduction
let before = dataset.manifest.version;
let result = UpdateBuilder::new(dataset.clone())
.update_where("id < 0")? // matches nothing
.set("name", "'bar'")?
.build()?
.execute()
.await?;
assert_eq!(result.rows_updated, 0);
assert_eq!(result.new_dataset.manifest.version, before); // fails: before + 1
The existing test no_op_update_ignores_explicit_exact_version exercises the same path and passes because it never checks the version.
Proposed fix
In UpdateJob::commit_impl, when num_updated_rows == 0 and there are no removed, updated or new fragments, return the input dataset with rows_updated: 0 instead of committing. Nothing is written in that case, so there is nothing to clean up, and a transaction with no affected rows can never conflict, so skipping it cannot change any outcome except the version number.
Still present on main (checked at v14.0.0-beta.6). A patch with a test, against v12.0.0, is at https://github.com/rotty3000/lance/commit/d21067c02 — happy to open a PR against main.
- Lingua principale
- Rust
- Stelle
- 7.2k
- Fork
- 913
- Merge medio
- 5g 3h
- PR unite (30g)
- 427
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di lance-format/lance
-
feature performance
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
lance-format/lance#10137 ·
I maintainer di solito rispondono entro 3 giorni
-
Upgrade DataFusion for the unparser stack-overflow fixForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
lance-format/lance#8225 ·
I maintainer di solito rispondono entro 3 giorni
-
enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
lance-format/lance#6425 · 2 commenti ·
I maintainer di solito rispondono entro 3 giorni
-
Expose compute_pq_distanceForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertaenhancement
Difficoltà 1/5 1-3 ore Idoneità per principianti 62/100
lance-format/lance#5675 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
documentation
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
lance-format/lance#5240 ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di lance-format/lance
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
o8 next debug build aborts on Glass to Dark appearance switch (nil identifier messaged before check)Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
hurttlocker/o8#5112 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
memory_patch_page drops the `#` of headings like `## Notes on C#`Forse già presa @viniciusdsandrade l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
akitaonrails/ai-memory#1859 ·
I maintainer di solito rispondono entro 1 giorno