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

colblk: fix UintsBuilder bug in default mode #4078

Merged
merged 1 commit into from
Oct 20, 2024

Conversation

RaduBerinde
Copy link
Member

When we are in useDefault mode, the slice can be smaller than the
number of rows. In that case, the existing code was reading outside
the underlying slice and writing out garbage.

We should reconsider the use of UnsafeSlice here, as I don't think
it's buying us much performance-wise.

Informs cockroachdb/cockroach#132964

When we are in `useDefault` mode, the slice can be smaller than the
number of rows. In that case, the existing code was reading outside
the underlying slice and writing out garbage.

We should reconsider the use of `UnsafeSlice` here, as I don't think
it's buying us much performance-wise.
@RaduBerinde RaduBerinde requested a review from a team as a code owner October 19, 2024 04:52
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@RaduBerinde
Copy link
Member Author

It's worth noting that TestCockroachDataBlock finds this issue on master (now that we also generate some logical times):

go test -tags invariants --exec 'stress -p 4' -timeout 0 -v ./sstable/colblk -run CockroachDataBlock

=== RUN   TestCockroachDataBlock
    cockroach_test.go:27: seed: 1729349928313842000
--- FAIL: TestCockroachDataBlock (0.00s)
panic: incorrect target width [recovered]
        panic: incorrect target width

The test passes reliably with the fix.

Copy link
Collaborator

@jbowens jbowens 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 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @RaduBerinde)

Copy link
Collaborator

@jbowens jbowens left a comment

Choose a reason for hiding this comment

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

Good catch!

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @RaduBerinde)

@RaduBerinde
Copy link
Member Author

TFTR!

@RaduBerinde RaduBerinde merged commit ce4dcc9 into cockroachdb:master Oct 20, 2024
23 checks passed
@RaduBerinde RaduBerinde deleted the fix-uints-default branch October 20, 2024 01:04
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