Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-10301

Search for items past end of descending BTreeSearchIterator can fail

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Urgent
    • Resolution: Fixed
    • Fix Version/s: 3.0.0 rc1
    • Component/s: None
    • Labels:
      None
    • Severity:
      Critical

      Description

      A very simple problem, but obvious and with simple fix once it is made apparent.

      The internal seekTo method uses binarySearch semantics for its return value, however when searching backwards -1 is a real value that should be returned to the client, as it indicates "past the end" - so basing inexact matches from -1 leads to a conflicting meaning, and so it gets misinterpreted. Rebasing inexact results to -2 fixes the problem.

      This was not caught because the randomized testing apparently did not test for values outside the bounds of the btree. This has been fixed as well, and the tests did easily exhibit the problem without the fix.

        Attachments

          Activity

            People

            • Assignee:
              benedict Benedict Elliott Smith
              Reporter:
              benedict Benedict Elliott Smith
              Authors:
              Benedict Elliott Smith
              Reviewers:
              Branimir Lambov
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: