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: colserde: fix the edge case with nulls handling #62915

Merged
merged 1 commit into from
May 13, 2021

Conversation

yuzefovich
Copy link
Member

Backport 1/1 commits from #62642.

/cc @cockroachdb/release


When serializing the data of Bool, Bytes, Int, and Float types when they
don't have any nulls in the vector, we don't explicit specify the null
bitmap. Previously, when deserializing such vectors with no nulls we
would simply call UnsetNulls on the coldata.Nulls object that is
currently present. However, it is possible that already present nulls
object cannot support the desired batch length. This could lead to index
out of bounds accesses. Note that in the vast majority of cases this
likely doesn't happen in practice because we check MaybeHasNulls, and
that would return false making us omit the null checking code.

Fixes: #62636.

Release note (bug fix): Previously, CockroachDB could encounter an
internal error in rare circumstances when executing queries via the
vectorized engine that operate on columns of BOOL, BYTES, INT, and FLOAT
types that have a mix of NULL and non-NULL values.

When serializing the data of Bool, Bytes, Int, and Float types when they
don't have any nulls in the vector, we don't explicit specify the null
bitmap. Previously, when deserializing such vectors with no nulls we
would simply call `UnsetNulls` on the `coldata.Nulls` object that is
currently present. However, it is possible that already present nulls
object cannot support the desired batch length. This could lead to index
out of bounds accesses. Note that in the vast majority of cases this
likely doesn't happen in practice because we check `MaybeHasNulls`, and
that would return `false` making us omit the null checking code.

Release note (bug fix): Previously, CockroachDB could encounter an
internal error in rare circumstances when executing queries via the
vectorized engine that operate on columns of BOOL, BYTES, INT, and FLOAT
types that have a mix of NULL and non-NULL values.
@yuzefovich yuzefovich requested review from rytaft and asubiotto March 31, 2021 23:39
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@yuzefovich
Copy link
Member Author

I believe this PR could be justified for backport to 21.1.0 since it fixes a logic issue, yet the issue has been present in previous releases too, so I wonder whether we should hold off with the fix till 21.1.1.

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: This isn't fixing a panic, right? If it's just an internal error for a rare bug, I'd hold off till 21.1.1 since we're trying to slow down the pace of backports now and limit them to fixes for release blockers.

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

@rytaft
Copy link
Collaborator

rytaft commented Apr 1, 2021

it fixes a logic issue

returning incorrect results would also qualify as reason for a backport if that's what you meant by this

@yuzefovich
Copy link
Member Author

Yeah, the impact of the bug is that the user might encounter an internal error (it is actually a panic which is converted into an error by our panic-catcher). I'll hold off on merging until 21.1.0 is done.

@yuzefovich yuzefovich added the do-not-merge bors won't merge a PR with this label. label Apr 1, 2021
@rytaft
Copy link
Collaborator

rytaft commented Apr 1, 2021

sounds good thanks!

@yuzefovich yuzefovich removed the do-not-merge bors won't merge a PR with this label. label May 13, 2021
@yuzefovich yuzefovich merged commit 1c1555b into cockroachdb:release-21.1 May 13, 2021
@yuzefovich yuzefovich deleted the backport21.1-62642 branch May 13, 2021 05:38
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.

3 participants