mirror of
https://github.com/ModernRelay/omnigraph.git
synced 2026-07-12 03:12:11 +02:00
iss-merge-rowid-overlap-corrupts-filtered-reads / lance#7444: an
update-style merge_insert over a merge-written fragment legally reuses the
updated rows' stable row ids (row-id-lineage spec: updates preserve
_rowid) while the superseded fragment keeps its full sequence plus a
deletion vector. A later delete leaves the overlapping id range sparsely
tiled, and lance-table 7.0.0's RowIdIndex::new asserted dense tiling —
failing every filtered read that builds the id→address map ("Wrong range"
debug assert; "all columns in a record batch must have the same length"
or a silently-wrong batch in release).
The upstream fix (lance#7480, merged 2026-07-01) landed hours AFTER
v8.0.0 was cut, so no release ≤ 8.0.0 carries it. Consume it now as a
vendored pin: vendor/lance-table is the pristine published 7.0.0 source
plus ONLY the #7480 rowids/index.rs hunk (drop the false tiling assert;
hard-error on the true invariant — one live id claimed by two fragments)
and upstream's regression unit test, wired via [patch.crates-io]. The fix
is read-side only, so already-written graphs become readable as-is — no
data repair.
Removal condition (see vendor/lance-table/README.omnigraph.md): drop the
vendor dir + patch entry at the first Lance bump whose lance-table ships
lance#7480 (9.0.0, or a backported 8.0.1). The surface guard
filtered_scan_tolerates_merge_update_row_id_overlap keeps that honest in
both directions.
Turns the previous commit's red tests green. Full workspace gate passes
(cargo test --workspace --locked --no-fail-fast, 68 suites).
42 lines
1.3 KiB
Rust
Executable file
42 lines
1.3 KiB
Rust
Executable file
// SPDX-License-Identifier: Apache-2.0
|
|
// SPDX-FileCopyrightText: Copyright The Lance Authors
|
|
|
|
//! Transaction struct for lance-table format layer.
|
|
//!
|
|
//! This struct is introduced to provide a Struct-first API for passing transaction
|
|
//! information within the lance-table crate. It mirrors the protobuf Transaction
|
|
//! message at a semantic level while remaining crate-local, so lance-table does
|
|
//! not depend on higher layers (e.g., lance crate).
|
|
//!
|
|
//! Conversion to protobuf occurs at the write boundary. See the `From<Transaction>`
|
|
//! implementation below.
|
|
|
|
use crate::format::pb;
|
|
|
|
#[derive(Clone, Debug, PartialEq)]
|
|
pub struct Transaction {
|
|
/// Crate-local representation backing: protobuf Transaction.
|
|
/// Keeping this simple avoids ring dependencies while still enabling
|
|
/// Struct-first parameter passing in lance-table.
|
|
pub inner: pb::Transaction,
|
|
}
|
|
|
|
impl Transaction {
|
|
/// Accessor for testing or internal inspection if needed.
|
|
pub fn as_pb(&self) -> &pb::Transaction {
|
|
&self.inner
|
|
}
|
|
}
|
|
|
|
/// Write-boundary conversion: serialize using protobuf at the last step.
|
|
impl From<Transaction> for pb::Transaction {
|
|
fn from(tx: Transaction) -> Self {
|
|
tx.inner
|
|
}
|
|
}
|
|
|
|
impl From<pb::Transaction> for Transaction {
|
|
fn from(pb_tx: pb::Transaction) -> Self {
|
|
Self { inner: pb_tx }
|
|
}
|
|
}
|