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

libroach: Don't assert on nonzero min timestamp hints in iterators #41217

Merged
merged 1 commit into from
Sep 30, 2019

Conversation

itsbilal
Copy link
Member

Currently, if either a min or max timestamp hint is provided to a
RocksDB iterator, we assert that both are non-zero. In practice,
we only need to assert on the max one being nonzero; a zero min
timestamp hint when encoded would sort before all timestamps, and
would not filter out any SSTs. A zero max timestamp
hint could filter out all SSTs, which would be worth asserting on.

Fixes #41200 .

Release justification: Fixes assertions that are currently failing
in tests, no risk otherwise.

Release note: None

Currently, if either a min or max timestamp hint is provided to a
RocksDB iterator, we assert that both are non-zero. In practice,
we only need to assert on the max one being nonzero; a zero min
timestamp hint when encoded would sort before all timestamps, and
would not filter out any SSTs. A zero max timestamp
hint could filter out all SSTs, which would be worth asserting on.

Fixes cockroachdb#41200 .

Release justification: Fixes assertions that are currently failing
in tests, no risk otherwise.

Release note: None
@itsbilal itsbilal self-assigned this Sep 30, 2019
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@itsbilal
Copy link
Member Author

For reference, here's the only place timestamp hints are used: https://github.com/cockroachdb/cockroach/blob/master/c-deps/libroach/iterator.cc#L51

Copy link
Collaborator

@petermattis petermattis left a comment

Choose a reason for hiding this comment

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

So has this been broken "forever" and we just never noticed because of not having asserts enabled?

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @dt and @petermattis)

@itsbilal
Copy link
Member Author

Seems like it. That assertion has been there for at least a year.

Thanks for the review!

bors r+

craig bot pushed a commit that referenced this pull request Sep 30, 2019
41217: libroach: Don't assert on nonzero min timestamp hints in iterators r=itsbilal a=itsbilal

Currently, if either a min or max timestamp hint is provided to a
RocksDB iterator, we assert that both are non-zero. In practice,
we only need to assert on the max one being nonzero; a zero min
timestamp hint when encoded would sort before all timestamps, and
would not filter out any SSTs. A zero max timestamp
hint could filter out all SSTs, which would be worth asserting on.

Fixes #41200 .

Release justification: Fixes assertions that are currently failing
in tests, no risk otherwise.

Release note: None

Co-authored-by: Bilal Akhtar <bilal@cockroachlabs.com>
@craig
Copy link
Contributor

craig bot commented Sep 30, 2019

Build succeeded

@craig craig bot merged commit d5a1bf7 into cockroachdb:master Sep 30, 2019
@knz knz mentioned this pull request Oct 2, 2019
18 tasks
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.

teamcity: failed test: TestRandomKeyAndTimestampExport
4 participants