Repository navigation
fix: keep stable row IDs when cloning or branching an emptied table - #9768
Merged
westonpace merged 2 commits intoOct 12, 2026
Merged
westonpace merged 2 commits into
westonpace merged 2 commits into
Conversation
A shallow clone kept only the covering-index and sticky feature flags of its source and left the commit to re-derive the rest. The stable-row-ID flag is derived from the fragments' row-ID metadata, so a copy of a table whose rows had all been deleted lost it: rows appended to the copy got no stable row IDs even though it carried the source's next_row_id. Branches are shallow clones and were affected the same way; deep clones copy the source manifest as is. Keep FLAG_STABLE_ROW_IDS in shallow_clone's reader and writer flags.
brendanclement
marked this pull request as ready for review
October 7, 2026 21:52
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The fix preserves stable-row-ID mode and the allocation counter when an emptied table is shallow-cloned or branched. The persisted reopen-and-append regression covers the failure across all three copy modes; no merge-blocking issue found.
brendanclement
added a commit
to brendanclement/lance
that referenced
this pull request
Oct 13, 2026
… only) Two textual conflicts. rust/lance-table/src/format/manifest.rs: the clone flag mask takes main's split STICKY_READER_FLAGS / STICKY_WRITER_FLAGS with lance-format#9768's FLAG_STABLE_ROW_IDS, the form lance-format#9768 landed in on main. rust/lance/src/dataset/optimize.rs: records_stable_row_id_moves keeps lance-format#9611's reworded doc comment with this branch's added sentence. lance-format#9611 replaced the _frag_reuse_with_stable_row_ids_enabled binding with the srid_recording_enabled fixture, which finds the gate by compacting. This branch's three recording tests take the fixture, and the CI job that runs them with recording on proves it the same way before running them, since they also pass on the refusal.
brendanclement
added a commit
to brendanclement/lance
that referenced
this pull request
Oct 13, 2026
No conflicts. Brings in lance-format#9768 as it landed on main, which this branch carried at its earlier head fe811c7.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A shallow clone or branch of a stable-row-ID table whose rows had all been deleted lost stable row IDs.
Manifest::shallow_clonekeeps only the covering-index and sticky feature flags from the source, and the commit re-derives the rest when it writes the copy's manifest. It derives the stable-row-ID flag from the fragments' row-ID metadata, but an emptied table has no fragments left, so nothing restored the flag. The copy still carriednext_row_id, yet rows appended to it got no stable row IDs. A branch is a shallow clone, so it was affected the same way. A deep clone copies the source manifest as is and was not affected.shallow_clonenow also keepsFLAG_STABLE_ROW_IDS, so the copy keeps stable row IDs and continues assigning them from the source'snext_row_id. A comment inwrite_manifest_filethat described the old masking is updated.Without the fix, the shallow-clone and branch cases fail on the reader flag