Repository navigation
feat: support FRI and stable row ids as long as there are no row-id-domain indexes - #9453
Closed
westonpace wants to merge 5 commits into
Closed
westonpace wants to merge 5 commits into
westonpace wants to merge 5 commits into
Conversation
Compaction refused `defer_index_remap` on a stable-row-id dataset on the grounds that stable row ids need no remapping. That holds for the row-id-domain indices, but not for the address-domain ones: a zone map or bloom filter is built over `_rowaddr`, and a rewrite moves every address it stores. With nothing to repair those addresses, the rewritten fragments were dropped from such an index's coverage and the scanner fell back to a full scan -- correct answers, but the index stopped earning its keep. Allow the two together so the fragment-reuse index can carry the repair: - Capture row addresses whenever a deferred remap is requested rather than only when row ids are unstable. - Rechunk stable row ids *and* resolve the captured addresses in the rewrite task. These sat in mutually exclusive branches, so capturing addresses would otherwise skip `rechunk_stable_row_ids`. Stable row ids are captured sequence-style, so only the row-id index knows the address each one sat at. - Let an address-domain index follow its data to the new fragments when the commit carries an FRI, instead of dropping the rewritten fragments. Narrow the rejection rather than removing it. An FRI is applied to every index on load, and with stable row ids the two domains diverge: a stable row id is numerically indistinguishable from an address into fragment 0, so an FRI applied to a btree would silently rewrite valid row ids rather than fail. The two therefore cannot coexist on a stable-row-id dataset, and both sides now refuse to create the pair: - Compaction rejects a deferred remap while a row-id-domain index is present, at the plan boundary and again at the commit boundary, since a caller may supply its own planner or commit a plan made before the index existed. - `create_index` rejects a row-id-domain index while a non-empty FRI is present. An unclassifiable type is refused rather than allowed. Both classifiers treat an unknown type as row-id-domain, so a type missing from either list costs a refused operation, never silent corruption. This restriction drops out once every index stores row addresses. Co-Authored-By: Claude Opus 5 <[email protected]>
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The deferred-remap path now preserves address-domain index coverage while rejecting stable-row-ID/FRI combinations with row-ID-domain indices at both request and commit boundaries. The prior alias and concurrent-commit gaps are closed, including both race orderings.
Member
Author
|
This was replaced by #9514 which is now part of a stack |
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.
The combination of stable row ids, the FRI, and indexes that store row ids is invalid. We want to eventually move away from row-id-domain indexes.
The current enforcement, however, prevents deferred compaction if there are stable row ids. We need to loosen this check slightly, so that we allow deferred compaction as long as we don't have row-id-domain indexes.
This means we also have to prevent the creation of row-id-domain indexes if there is an FRI.