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-21.1: opt: do not provide project ordering for columns removed when simplified #64481

Merged
merged 1 commit into from
May 13, 2021

Conversation

mgartner
Copy link
Collaborator

Backport 1/1 commits from #64444.

/cc @cockroachdb/release


Previously, projectCanProvideOrdering did not simplify an ordering
base on an FD set if the original ordering could be provided, while
projectBuildChildReqOrdering always attempted to simplify an ordering.
In #64342 the behavior of OrderingChoice.Simplify changed to remove
columns in groups that are not known to be equivalent by the FD. As a
result, projectCanProvideOrdering could return true in cases where the
simplified ordering, with some columns removed, could not be provided,
causing ordering.projectBuildChildReqOrdering to panic.

This commit updates ordering.projectCanProvideOrdering so that the
ordering is always simplified, matching the behavior of
ordering.projectBuildChildReqOrdering.

Fixes #64399

Release note: None

@mgartner mgartner added the do-not-merge bors won't merge a PR with this label. label Apr 30, 2021
@mgartner mgartner requested review from rytaft and RaduBerinde April 30, 2021 16:39
@mgartner mgartner requested a review from a team as a code owner April 30, 2021 16:39
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@mgartner
Copy link
Collaborator Author

Do not merge until 21.1.1.

@mgartner
Copy link
Collaborator Author

I'll have to rebase once #64348 is merged to get the tests passing here.

Copy link
Collaborator

@rytaft rytaft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 3 of 3 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @RaduBerinde)

Previously, `projectCanProvideOrdering` did not simplify an ordering
base on an FD set if the original ordering could be provided, while
`projectBuildChildReqOrdering` always attempted to simplify an ordering.
In cockroachdb#64342 the behavior of `OrderingChoice.Simplify` changed  to remove
columns in groups that are not known to be equivalent by the FD. As a
result, `projectCanProvideOrdering` could return true in cases where the
simplified ordering, with some columns removed, could not be provided,
causing `ordering.projectBuildChildReqOrdering` to panic.

This commit updates `ordering.projectCanProvideOrdering` so that the
ordering is always simplified, matching the behavior of
`ordering.projectBuildChildReqOrdering`.

Fixes cockroachdb#64399

Release note: None
@mgartner mgartner force-pushed the backport21.1-64444 branch from b0bb494 to 6b69e94 Compare May 13, 2021 15:43
@mgartner mgartner merged commit 1dfd205 into cockroachdb:release-21.1 May 13, 2021
@mgartner mgartner deleted the backport21.1-64444 branch May 13, 2021 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge bors won't merge a PR with this label.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants