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

db: fix bug in seek noop optimization and add more testing #1069

Merged
merged 1 commit into from
Feb 22, 2021

Conversation

sumeerbhola
Copy link
Collaborator

  • SeekLT had a bug that included the equality case in
    the comparison.
  • Added an explicit error handling test, that checks
    that the optimization is not used when the
    InternalIterator returns an error. This test also
    exercises some non-error cases, including the bug.
  • Added randomization on when the optimization is
    applied when invariants.Enabled is true.
  • Added a comment explaining why this optimization
    is not used when the batch is non-nil. Also, we
    no longer copy the seek key when batch is non-nil,
    since that copy is wasted.
  • Added support for Iterator.Clone to the metamorphic
    test.

- SeekLT had a bug that included the equality case in
  the comparison.
- Added an explicit error handling test, that checks
  that the optimization is not used when the
  InternalIterator returns an error. This test also
  exercises some non-error cases, including the bug.
- Added randomization on when the optimization is
  applied when invariants.Enabled is true.
- Added a comment explaining why this optimization
  is not used when the batch is non-nil. Also, we
  no longer copy the seek key when batch is non-nil,
  since that copy is wasted.
- Added support for Iterator.Clone to the metamorphic
  test.
@cockroach-teamcity
Copy link
Member

This change is Reviewable

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 7 files at r1.
Reviewable status: 2 of 7 files reviewed, all discussions resolved (waiting on @itsbilal and @petermattis)

@sumeerbhola
Copy link
Collaborator Author

TFTR!

@sumeerbhola sumeerbhola merged commit 560af6e into cockroachdb:master Feb 22, 2021
@sumeerbhola sumeerbhola deleted the noop_seekge branch October 26, 2021 13:20
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