Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-authored-by: Drew <[email protected]>
Co-authored-by: Drew <[email protected]>
Appends go through the existing insert writer and land as AddFragment and AddDataFile on the reusable ApplyState. A scan pins publication to the base version. Appends that were not scanned can rebase. The uncommitted snapshot uses u64::MAX so commit and maintenance reject it. Co-authored-by: Drew <[email protected]>
…mat#10780) This PR adds `local_fragment_aliases` to IndexMetadata and reserves feature flag `FLAG_LOCAL_FRAGMENT_ALIASES` so index files can keep their stored fragment IDs when a commit assigns different committed fragment IDs. The main use case is committing an append and its index together. If another writer commits first and changes the assigned fragment IDs, the retry can update local_fragment_aliases and fragment_bitmap together instead of rewriting the index files. For example, an index storing (17, 5) can alias 17 -> 42, and a rebase to fragment 43 updates local_fragment_aliases to {17: 43} and fragment_bitmap to {43}. Segments that already store committed fragment IDs omit the map. When present, the map is resolved before the Fragment Reuse Index (FRI). Writers that reuse existing index files must preserve the map, and readers must reject any map they cannot interpret. This PR adds the protobuf definition updates the spec in `index.md`, and adds a read guard that rejects mapped segments until reader support lands. The reader and writer feature flag bit is still unassigned. Writing mapped indexes, applying the map on read, and wiring up index maintenance will follow in separate PRs. Related to lance-format#7954, lance-format#10386, and lance-format#10722. ### Testing - `cargo test -p lance-table --lib` - `cargo clippy --all-targets -- -D warnings` - `cargo run --locked --manifest-path protos/codegen/Cargo.toml -- --check` - `mkdocs build --strict` --------- Co-authored-by: Drew <[email protected]>
…tenance Co-authored-by: Drew <[email protected]>
Co-authored-by: Drew <[email protected]>
Co-authored-by: Drew <[email protected]>
|
Important Format specification voteThis PR modifies the Lance format specification, so it requires 3 binding +1 votes from PMC members (excluding the proposer), at least one of them on the latest commit, and a minimum 72-hour voting period, weekends excluded, before it can merge. Vote by approving this PR (+1) or requesting changes (−1, a veto). See the voting process. Approvals carry over across pushes, so a rebase or a typo fix does not send everyone back to re-vote. Whoever approves the latest commit is vouching that nothing substantive has changed since the earlier approvals; if something has, ask for fresh votes. Status: ❌ Blocked — 1 of 3 required approvals
Updated automatically by the format-spec vote gate, which re-checks every 15 minutes — just voted? Re-check now (press Run workflow; leave the input blank to re-check every open format PR). A PMC member may apply the |
Xuanwo
left a comment
There was a problem hiding this comment.
Thank you @geruh for working on this!
I left a blocking comment on staged base-ID remapping for Blob v2 descriptors. Alongside fixing that invariant, could we also add regression coverage for both Managed and External Blob v2 descriptors verifying either that the original bytes are returned after reopen or that a conflicting commit fails explicitly, while keeping nonconcurrent use working?
| actions.extend(actions_for_appended_fragment( | ||
| Ref::Local(local_id), | ||
| fragment, | ||
| |base_id| self.base_reference(base_id), | ||
| )?); | ||
| } | ||
| let step = UserStep::new("append", actions); | ||
| let pins_base_version = step_pins_base_version(&step, &self.base.manifest)?; | ||
| let promotes_legacy_blob = | ||
| step_promotes_legacy_blob(&self.state.append_base.manifest.schema, &step.actions); | ||
| let next_working = self.state.working.apply_step_checked(&step)?; | ||
| self.state.working = next_working; | ||
| self.state.steps.push(step); | ||
| self.state.staged_dataset = None; | ||
| self.state.append_context_dirty |= promotes_legacy_blob; | ||
| self.state.next_local_fragment_id = next_local_fragment_id; | ||
| self.state.requires_original_version |= pins_base_version; |
There was a problem hiding this comment.
DataFile.base_id is remapped through transaction-local base references on commit, while already persisted Managed and External Blob v2 descriptors (including an external descriptor stored in a primary data file) can retain the staging-time numeric base ID. On replay, this can commit a manifest inconsistent with its immutable data.
Could we preserve the blob-to-base binding across replay, or use the existing requires_original_version guard where safe replay cannot be guaranteed?
Co-authored-by: Drew <[email protected]>
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The version guard addresses the Blob v2 base-binding finding: affected blob appends now reject a conflicting commit, while nonconcurrent commits preserve the intended bytes after reopen.
Please mark this PR with the breaking-change label: lance_table::format::IndexMetadata and lance_table::format::pb::IndexMetadata gained the required local_fragment_aliases field, so Rust callers constructing either with struct literals must initialize it.
de69e45 to
7acc64d
Compare
Summary
Adds
add_basestoStagedTransactionso you can register new storage bases, append data into them, and build or extend indexes in one atomic commit.How it works
flowchart LR A["add_bases(bases)"] --> B["AddBase with local base ID"] B --> C["append_with_params(target)"] C --> D["AddDataFile with Ref::Local(base)"] D --> E["commit()"] E --> F["Resolve final base IDs"]Each new base gets a local ID until commit. Setting
append_context_dirty = truemakes the next append rebuild the staged snapshot soInsertBuildercan see the new bases by name, path, ortarget_all_bases.When
stage_appendbuilds theAddDataFileactions,base_referencemaps existing bases toRef::Committedand newly added bases toRef::Local. It looks through the stagedAddBaseactions rather than keeping another map inStagedState.On commit,
ApplyStateassigns the final base IDs and resolves those references. This also lets the transaction rebase if another writer adds bases first, without rewriting the data or index files.Per-base storage credentials aren't supported on staged appends yet.
Testing
Tested with stable row IDs on and off. Covers single and batch
add_bases, append and append stream, targeting bases by name or path andtarget_all_bases, index creation and extension, concurrent rebasing of base and fragment IDs, duplicate names and paths, abort, compaction, and index optimization.