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

sstable: fix sstable.Writer key order checks for nil keys #1135

Merged
merged 1 commit into from
May 11, 2021

Commits on May 11, 2021

  1. sstable: fix sstable.Writer key order checks for nil keys

    Fix the `sstable.Writer.addPoint` key order check which was incorrectly
    firing when a nil user key was added to the DB. The problem was that
    comparing the zero value of `w.meta.LargestPoint` vs a nil user-key was
    simply invalid. Instead, we need to avoid this check when a point record
    has never been added to the sstable, similar to what is done in
    `sstable.Writer.addTombstone`.
    
    Also fix the setting of `w.meta.SmallestPoint` to ensure that
    `w.meta.SmallestPoint.UserKey` is always non-nil after a point record
    has been added. This is necessary for `WriterMetadata.Smallest` to work
    correctly so that the sstable bounds can be set correctly if the
    smallest record in an sstable as a nil or zero-length user key.
    
    Fixes cockroachdb#1133
    petermattis committed May 11, 2021
    Configuration menu
    Copy the full SHA
    6933a5a View commit details
    Browse the repository at this point in the history