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

o.a.c.dht.Range.differenceToFetch() doesn't handle all cases correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 0.8.5
    • None
    • None
    • Normal

    Description

      It's possible that differenceToFetch is making implicit assumptions about the relationship between the two ranges, but the following cases are not handled correctly (the old range is (A, B], the new is (C, D]:

      --C--A-----B--D--
      

      Here, the result will be (C, A] and (D, B], instead of (C, A] and (B, D].

      --C--A-----D--B--
      

      The result will be (C, D] instead of just (C, A].

      --A--C-----D--B--
      

      The result will be (B, D] when nothing needs to be transfered.

      If there is some kind of implicit assumption that these cases won't arise, it either needs to be explicit (assertions, exceptions) or the cases need to be handled. It should be easy to cover this with unit tests.

      Attachments

        1. 3084-unit-test.txt
          6 kB
          Tom Hobbs
        2. 3084.txt
          4 kB
          Tom Hobbs
        3. 3084-v2.txt
          3 kB
          Tom Hobbs

        Activity

          People

            thobbs Tom Hobbs
            thobbs Tom Hobbs
            Tom Hobbs
            Stu Hood
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: