Repository navigation
feat: enable the fragment reuse index on stable row id datasets - #9120
Conversation
ec31dd7 to
1b17fdc
Compare
404d41e to
6222bf0
Compare
|
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 — 0 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 |
6222bf0 to
a70d498
Compare
a70d498 to
09c42ce
Compare
westonpace
left a comment
There was a problem hiding this comment.
I think we independently tackled some of the same space (I just created #9453).
I think this PR is maybe a bit more complex than it needs to be. We are hoping to move all indexes to be address domain indexes going forwards. So we can treat row id indexes as a sort of temporary state that we don't have to support that solidly.
For example, this PR jumps through a lot of hoops to try and figure out if a JSON index is a row address or row id index. We can just hardcode row-id for now (a conservative default) and wait until all the other indexes have switched to row address and then assume the JSON index is also a row address index at that point.
Also, instead of trying to make FRI & row-id domain indexes compatible we can just reject the FRI/SRID/row-id-domain index combination entirely (since we will migrate away from it). So some of these changes in frag_reuse.rs and manifest_build.rs might be overkill.
670460d to
0884479
Compare
There was a problem hiding this comment.
✅ Gate recommendation: approve.
This revision adopts the conservative boundary discussed in the maintainer review: stable-row-ID tables with an FRI admit only supported physical-address indices that apply the mapping. Publication rejects incompatible indices, and readers exclude them from query planning. The feature remains debug-only while deferred compaction recording and retention are completed in follow-up work.
0884479 to
4529044
Compare
Groundwork for the fragment reuse index on stable-row-ID tables. An index whose entries are stable row ids would have them rewritten as addresses, so such a table may only carry indices this build can prove store row addresses and apply the fragment reuse index (today ZoneMap and BloomFilter). - write_manifest_file validates the full manifest and index list, covering normal, retried and detached commits, clones and restore, and derives FLAG_FRAG_REUSE_WITH_STABLE_ROW_IDS for every version. - The flag is supported only in debug builds, and release builds refuse to publish the combination, until continuous recording and retention land. - Readers hide indices that cannot be proven compatible, and the shared remapper refuses to hand them the fragment reuse index. - create_index refuses vector and full-text requests before training and judges scalar requests on the index built. - The stable-row-ID rewrite no longer recalculates the fragment reuse index's own bitmap. Compaction still refuses defer_index_remap on stable-row-ID tables.
4529044 to
49b431b
Compare
…-ID tables Depends on the two commits below it: - feat: validate stable-row-ID tables that carry a fragment reuse index (lance-format#9120), for the eligibility check and the debug-only gate; - fix: exact FRI watermark for retention, remap and segment merge, so that an index built before a recorded rewrite publishes keeps the mapping it needs once its coverage follows the rewrite. A deferred compaction (defer_index_remap) on a stable-row-ID table now records its row-address moves in the fragment reuse index, including on tables with no indices and for groups no index covers. Release builds still refuse the option there. - The planner accepts the option only if every index passes the eligibility check, and names each offending index otherwise. It also refuses a table whose manifest still requires a tagged fragment reuse history, which stable row IDs exclude. - Recording tasks take the moved rows' old addresses from fragment metadata and deletion vectors. They refuse task fragments out of id order and a live-row count that disagrees with the rewrite. Row lineage is placed for every stable-row-ID task, recording or not. - The commit records when the option is set or when every task recorded, so a commit without options keeps the moves and normalizes the source fragments the same way. Mixed tasks, or the option with tasks that recorded nothing, are refused before any fragment id is reserved, and eligibility is checked again against the commit handle. - When a stable-row-ID rewrite carries a fragment reuse index, address indices keep their coverage and readers translate through it. Without one they drop the rewritten fragments as before. Tables without stable row IDs, and stable-row-ID compactions without the option, behave as before.
|
Rebased based on the latest main with CI fixes |
…-ID tables Depends on the two commits below it: - feat: validate stable-row-ID tables that carry a fragment reuse index (lance-format#9120), for the eligibility check and the debug-only gate; - fix: exact FRI watermark for retention, remap and segment merge, so that an index built before a recorded rewrite publishes keeps the mapping it needs once its coverage follows the rewrite. A deferred compaction (defer_index_remap) on a stable-row-ID table now records its row-address moves in the fragment reuse index, including on tables with no indices and for groups no index covers. Release builds still refuse the option there. - The planner accepts the option only if every index passes the eligibility check, and names each offending index otherwise. It also refuses a table whose manifest still requires a tagged fragment reuse history, which stable row IDs exclude. - Recording tasks take the moved rows' old addresses from fragment metadata and deletion vectors. They refuse task fragments out of id order and a live-row count that disagrees with the rewrite. Row lineage is placed for every stable-row-ID task, recording or not. - The commit records when the option is set or when every task recorded, so a commit without options keeps the moves and normalizes the source fragments the same way. Mixed tasks, or the option with tasks that recorded nothing, are refused before any fragment id is reserved, and eligibility is checked again against the commit handle. - When a stable-row-ID rewrite carries a fragment reuse index, address indices keep their coverage and readers translate through it. Without one they drop the rewritten fragments as before. Tables without stable row IDs, and stable-row-ID compactions without the option, behave as before.
…-ID tables Builds on lance-format#9120 (the eligibility check and the debug-only gate) and depends on the two commits below it: - fix: exact FRI watermark for retention, remap and segment merge, so that an index built before a recorded rewrite publishes keeps the mapping it needs once its coverage follows the rewrite; - fix: refuse a fragment reuse replacement built from a changed history, so that two recording compactions from separate sessions cannot discard each other's moves. A deferred compaction (defer_index_remap) on a stable-row-ID table now records its row-address moves in the fragment reuse index, including on tables with no indices and for groups no index covers. Release builds still refuse the option there. - The planner accepts the option only if every index passes the eligibility check, and names each offending index otherwise. It also refuses a table whose manifest still requires a tagged fragment reuse history, which stable row IDs exclude. - Recording tasks take the moved rows' old addresses from fragment metadata and deletion vectors. They refuse task fragments out of id order and a live-row count that disagrees with the rewrite. Row lineage is placed for every stable-row-ID task, recording or not. - The commit records when the option is set or when every task recorded, so a commit without options keeps the moves and normalizes the source fragments the same way. Mixed tasks, or the option with tasks that recorded nothing, are refused before any fragment id is reserved, and eligibility is checked again against the commit handle. - When a stable-row-ID rewrite carries a fragment reuse index, address indices keep their coverage and readers translate through it. Without one they drop the rewritten fragments as before. Tables without stable row IDs, and stable-row-ID compactions without the option, behave as before.
…-ID tables Builds on lance-format#9120 (the eligibility check and the debug-only gate) and depends on the two commits below it: - fix: exact FRI watermark for retention, remap and segment merge, so that an index built before a recorded rewrite publishes keeps the mapping it needs once its coverage follows the rewrite; - fix: refuse a fragment reuse replacement built from a changed history, so that two recording compactions from separate sessions cannot discard each other's moves. A deferred compaction (defer_index_remap) on a stable-row-ID table now records its row-address moves in the fragment reuse index, including on tables with no indices and for groups no index covers. Release builds still refuse the option there. - The planner accepts the option only if every index passes the eligibility check, and names each offending index otherwise. It also refuses a table whose manifest still requires a tagged fragment reuse history, which stable row IDs exclude. - Recording tasks take the moved rows' old addresses from fragment metadata and deletion vectors. They refuse task fragments out of id order and a live-row count that disagrees with the rewrite. Row lineage is placed for every stable-row-ID task, recording or not. - The commit records when the option is set or when every task recorded, so a commit without options keeps the moves and normalizes the source fragments the same way. Mixed tasks, or the option with tasks that recorded nothing, are refused before any fragment id is reserved, and eligibility is checked again against the commit handle. - When a stable-row-ID rewrite carries a fragment reuse index, address indices keep their coverage and readers translate through it. Without one they drop the rewritten fragments as before. Tables without stable row IDs, and stable-row-ID compactions without the option, behave as before.
…-ID tables Builds on lance-format#9120 (the eligibility check and the debug-only gate) and depends on the two commits below it: - fix: exact FRI watermark for retention, remap and segment merge, so that an index built before a recorded rewrite publishes keeps the mapping it needs once its coverage follows the rewrite; - fix: refuse a fragment reuse replacement built from a changed history, so that two recording compactions from separate sessions cannot discard each other's moves. A deferred compaction (defer_index_remap) on a stable-row-ID table now records its row-address moves in the fragment reuse index, including on tables with no indices and for groups no index covers. Release builds still refuse the option there. - The planner accepts the option only if every index passes the eligibility check, and names each offending index otherwise. It also refuses a table whose manifest still requires a tagged fragment reuse history, which stable row IDs exclude. - Recording tasks take the moved rows' old addresses from fragment metadata and deletion vectors. They refuse task fragments out of id order and a live-row count that disagrees with the rewrite. Row lineage is placed for every stable-row-ID task, recording or not. - The commit records when the option is set or when every task recorded, so a commit without options keeps the moves and normalizes the source fragments the same way. Mixed tasks, or the option with tasks that recorded nothing, are refused before any fragment id is reserved, and eligibility is checked again against the commit handle. - When a stable-row-ID rewrite carries a fragment reuse index, address indices keep their coverage and readers translate through it. Without one they drop the rewritten fragments as before. Tables without stable row IDs, and stable-row-ID compactions without the option, behave as before.
#9120 added a publication-time check for fragment reuse indices on stable row id datasets that rejects the same row-id-domain index combination. The duplicate gate fired first with a different error and broke its tests. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KqTXnUMz52CMzSjmDnutf6
#9120 already refuses creating a row-id-domain index on a stable row id dataset that carries a fragment reuse index. The test now matches that error's wording. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KqTXnUMz52CMzSjmDnutf6
…-ID tables Builds on lance-format#9120 (the eligibility check and the debug-only gate) and depends on the two commits below it: - fix: exact FRI watermark for retention, remap and segment merge, so that an index built before a recorded rewrite publishes keeps the mapping it needs once its coverage follows the rewrite; - fix: refuse a fragment reuse replacement built from a changed history, so that two recording compactions from separate sessions cannot discard each other's moves. A deferred compaction (defer_index_remap) on a stable-row-ID table now records its row-address moves in the fragment reuse index, including on tables with no indices and for groups no index covers. Release builds still refuse the option there. - The planner accepts the option only if every index passes the eligibility check, and names each offending index otherwise. It also refuses a table whose manifest still requires a tagged fragment reuse history, which stable row IDs exclude. - Recording tasks take the moved rows' old addresses from fragment metadata and deletion vectors. They refuse task fragments out of id order and a live-row count that disagrees with the rewrite. Row lineage is placed for every stable-row-ID task, recording or not. - The commit records when the option is set or when every task recorded, so a commit without options keeps the moves and normalizes the source fragments the same way. Mixed tasks, or the option with tasks that recorded nothing, are refused before any fragment id is reserved, and eligibility is checked again against the commit handle. - When a stable-row-ID rewrite carries a fragment reuse index, address indices keep their coverage and readers translate through it. Without one they drop the rewritten fragments as before. Tables without stable row IDs, and stable-row-ID compactions without the option, behave as before.
Enables `defer_index_remap` compaction on stable-row-ID datasets. Compaction captures pre-rewrite addresses and writes a fragment reuse index, and address-domain indexes (ZoneMap, BloomFilter) follow their data instead of losing coverage. Compaction refuses to defer while a row-id-domain index is present; the compatibility rules from #9120 cover index creation and publishing. --- <sub>Stack created with <a href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub> --------- Co-authored-by: Claude Opus 5 <[email protected]>
Part of the stable row ID GA work in §5.1. Adds validation for stable-row-ID datasets that carry a Fragment Reuse Index (FRI).
Allows the combination when there are no ordinary indexes, or every index uses a supported format, stores physical row addresses, and applies FRI mappings. Today, ZoneMap and BloomFilter qualify. Stable-ID indexes, JSON indexes, and unrecognized types or versions are rejected.
Validates the full index list before publishing a table version, including clone, restore, and rebased commits. Readers exclude incompatible indexes from query planning, and direct loads refuse to apply FRI mappings to them. Index creation uses the same compatibility rules.
Sets the reader and writer feature flag from #9119 per table version. Support remains debug-only, release builds refuse to publish the combination. This PR does not enable deferred compaction on stable-row-ID datasets.
Next steps