Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-2.1: storageccl: tolerate rewriting keys with fewer columns than expected #36006

Merged
merged 1 commit into from Mar 21, 2019

Conversation

dt
Copy link
Member

@dt dt commented Mar 20, 2019

Backport 1/1 commits from #35750.

/cc @cockroachdb/release


When rewriting a key, if it belongs to an index in which another is interleaved, once we rewrite past the table/index ID prefix, we previously would assume we had to skip exactly the number of columns indexed before checking if there was an interleave child ID to rewrite.

However, if a span's start or end key does not include all the index columns, this assumption is invalid. It is unclear why we'd have such a span boundary, but if we do, the key rewriter has technically done its job if it rewrites all the IDs in the prefix of a key and then finds the key ends in the middle of the column values. While unexpected, strictly from the point of view of the rewriter, the key's IDs are rewritten and it can return.

Release note (enterprise change): Fix a bug in RESTORE where some unusual range boundaries in interleaved tables caused an error.

When rewriting a key, if it belongs to an index in which another is interleaved, once we rewrite past the table/index ID prefix, we previously would assume we had to skip exactly the number of columns indexed before checking if there was an interleave child ID to rewrite.

However, if a span's start or end key does not include all the index columns, this assumption is invalid. It is unclear why we'd have such a span boundary, but if we do, the key rewriter has technically done its job if it rewrites all the IDs in the prefix of a key and then finds the key ends in the middle of the column values. While unexpected, strictly from the point of view of the rewriter, the key's IDs are rewritten and it can return.

Release note (enterprise change): Fix a bug in RESTORE where some unusual range boundaries in interleaved tables caused an error.
@dt dt requested review from maddyblue and a team March 20, 2019 21:24
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@dt dt merged commit b534e64 into cockroachdb:release-2.1 Mar 21, 2019
@dt dt deleted the backport2.1-35750 branch March 26, 2019 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants