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

interval/generic: improve randomized testing, fix upper bound bug #51939

Merged

Commits on Aug 3, 2020

  1. interval/generic: improve randomized testing, fix upper bound bug

    In an effort to track down the bug that triggered cockroachdb#51913, this commit
    ports the randomized interval btree benchmarks to also be unit tests.
    This allows us to run invariant checks (see `btree.Verify`) on randomized
    tree configurations.
    
    Doing so revealed a violation of the `isUpperBoundCorrect` invariant.
    This was determined to be a bug in `node.removeMax`. When removing an
    item from a grandchild node, we were failing to adjust the upper bound
    of the child node. It doesn't look like this could cause user-visible
    effects because the upper bound of a subtree is only ever decreased on
    removal, so at worst, this caused searches in the tree to do more work
    than strictly necessary. Still, this is a good bug to fix and it's
    encouraging that the new randomized testing using the existing invariant
    validation caught it.
    nvanbenschoten committed Aug 3, 2020
    Configuration menu
    Copy the full SHA
    dd76f4a View commit details
    Browse the repository at this point in the history
  2. interval/generic: s/a item/an item/g

    This was fallout from a previous `s/latch/item/g`.
    nvanbenschoten committed Aug 3, 2020
    Configuration menu
    Copy the full SHA
    33f86ff View commit details
    Browse the repository at this point in the history