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

Acquire read lock before accessing CompactionStrategyManager fields

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 3.11.2, 4.0-alpha1, 4.0
    • None
    • None
    • Normal

    Description

      There are a few methods in CompactionStrategyManager accessing the repaired/unrepaired compaction strategy lists without using the read lock, what could cause issues like the one below:

      ERROR [CompactionExecutor:1] 2017-12-22 12:17:12,320 CassandraDaemon.java:141 - Exception in thread Thread[CompactionExecutor:1,5,main]
      java.lang.IndexOutOfBoundsException: Index: 0, Size: 1
          at java.util.ArrayList.rangeCheck(ArrayList.java:657)
          at java.util.ArrayList.get(ArrayList.java:433)
          at org.apache.cassandra.db.compaction.CompactionStrategyManager.supportsEarlyOpen(CompactionStrategyManager.java:1262)
          at org.apache.cassandra.db.ColumnFamilyStore.supportsEarlyOpen(ColumnFamilyStore.java:558)
          at org.apache.cassandra.io.sstable.SSTableRewriter.construct(SSTableRewriter.java:119)
          at org.apache.cassandra.db.compaction.writers.CompactionAwareWriter.<init>(CompactionAwareWriter.java:91)
          at org.apache.cassandra.db.compaction.writers.DefaultCompactionWriter.<init>(DefaultCompactionWriter.java:57)
          at org.apache.cassandra.db.compaction.CompactionTask.getCompactionAwareWriter(CompactionTask.java:293)
          at org.apache.cassandra.db.compaction.CompactionTask.runMayThrow(CompactionTask.java:200)
          at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28)
          at org.apache.cassandra.db.compaction.CompactionTask.executeInternal(CompactionTask.java:90)
          at org.apache.cassandra.db.compaction.AbstractCompactionTask.execute(AbstractCompactionTask.java:101)
          at org.apache.cassandra.db.compaction.CompactionManager$BackgroundCompactionCandidate.run(CompactionManager.java:310)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at org.apache.cassandra.concurrent.NamedThreadFactory.lambda$threadLocalDeallocator$0(NamedThreadFactory.java:81)
          at java.lang.Thread.run(Thread.java:748)
      

      Attachments

        1. 3.11-14139-dtest.png
          58 kB
          Paulo Motta
        2. 3.11-14139-testall.png
          9 kB
          Paulo Motta
        3. trunk-14139-dtest.png
          68 kB
          Paulo Motta
        4. trunk-14139-testall.png
          22 kB
          Paulo Motta

        Issue Links

          Activity

            People

              pauloricardomg Paulo Motta
              pauloricardomg Paulo Motta
              Paulo Motta
              Marcus Eriksson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: