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

Ensure early reopening has no overlap with replaced files

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Urgent
    • Resolution: Fixed
    • 2.1.5
    • None
    • None
    • Critical

    Description

      When introducing CASSANDRA-6916 we permitted the early opened files to overlap with the files they were replacing by one DecoratedKey, as this permitted a few minor simplifications. Unfortunately this breaks assumptions in LeveledCompactionScanner, that are causing the intermittent unit test failures: http://cassci.datastax.com/job/trunk_utest/1330/testReport/junit/org.apache.cassandra.db.compaction/LeveledCompactionStrategyTest/testValidationMultipleSSTablePerLevel/

      This patch by itself does not fix the bug, but fixes the described aspect of it, by ensuring the replaced and replacing files never overlap. This is achieved first by always selecting the replaced file start as the next key present in the file greater than the last key in the new file(s). If there is no such key, however, there is no data to return for the reader, but to permit abort and atomic replacement at the end of a macro compaction action, we must keep the file in the DataTracker for replacement purposes, but not return it to consumers (esp. as many assume a non-empty range). For this I have introduced a new OpenReason called SHADOWED, and a DataTracker.View.shadowed collection of sstables, that tracks those we still consider to be in the live set, but from which we no longer answer any queries.

      CASSANDRA-8744 (and then CASSANDRA-8750) then ensures that these bounds are honoured, so that we never break the assumption that files in LCS never overlap.

      Attachments

        1. test.sh
          0.2 kB
          Alan Boudreault
        2. system.log
          7.55 MB
          Alan Boudreault
        3. 0001-avoid-NPE-in-getPositionsForRanges.patch
          2 kB
          Marcus Eriksson

        Issue Links

          Activity

            People

              benedict Benedict Elliott Smith
              marcuse Marcus Eriksson
              Benedict Elliott Smith
              Marcus Eriksson
              Alan Boudreault Alan Boudreault
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: