This is an automated email from the ASF dual-hosted git repository.

marcuse pushed a commit to branch cassandra-3.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit b48ba8a843b29178c2b39cafd1c9a1aae518f6b0
Merge: 78776d3 1d615a5
Author: Marcus Eriksson <[email protected]>
AuthorDate: Tue Mar 26 10:03:26 2019 +0100

    Merge branch 'cassandra-2.2' into cassandra-3.0

 CHANGES.txt                                            |  1 +
 .../cassandra/db/compaction/CompactionManager.java     |  3 ++-
 .../cassandra/io/sstable/IndexSummaryManager.java      | 18 ++++++++++++++++--
 src/java/org/apache/cassandra/utils/FBUtilities.java   |  2 +-
 .../cassandra/io/sstable/IndexSummaryManagerTest.java  | 14 +++++++++++++-
 5 files changed, 33 insertions(+), 5 deletions(-)

diff --cc CHANGES.txt
index fb9505b,e887733..0ea7e9e
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,12 -1,8 +1,13 @@@
 -2.2.15
 +3.0.19
 + * Avoid double closing the iterator to avoid overcounting the number of 
requests (CASSANDRA-15058)
 + * Improve `nodetool status -r` speed (CASSANDRA-14847)
 + * Improve merkle tree size and time on heap (CASSANDRA-14096)
 + * Add missing commands to nodetool-completion (CASSANDRA-14916)
 + * Anti-compaction temporarily corrupts sstable state for readers 
(CASSANDRA-15004)
 + Merged from 2.2:
+  * Fix index summary redistribution cancellation (CASSANDRA-15045)
   * Refactor Circle CI configuration (CASSANDRA-14806)
   * Fixing invalid CQL in security documentation (CASSANDRA-15020)
 - * Make tools/bin/token-generator py2/3 compatible (CASSANDRA-15012)
   * Multi-version in-JVM dtests (CASSANDRA-14937)
  
  
diff --cc src/java/org/apache/cassandra/io/sstable/IndexSummaryManager.java
index d9fef5f,3ebbb6e..507b6fa
--- a/src/java/org/apache/cassandra/io/sstable/IndexSummaryManager.java
+++ b/src/java/org/apache/cassandra/io/sstable/IndexSummaryManager.java
@@@ -40,9 -41,9 +41,10 @@@ import org.apache.cassandra.db.compacti
  import org.apache.cassandra.db.compaction.CompactionManager;
  import org.apache.cassandra.db.compaction.OperationType;
  import org.apache.cassandra.db.lifecycle.LifecycleTransaction;
 +import org.apache.cassandra.db.lifecycle.SSTableSet;
  import org.apache.cassandra.db.lifecycle.View;
  import org.apache.cassandra.io.sstable.format.SSTableReader;
+ import org.apache.cassandra.utils.FBUtilities;
  import org.apache.cassandra.utils.MBeanWrapper;
  import org.apache.cassandra.utils.Pair;
  import org.apache.cassandra.utils.WrappedRunnable;
diff --cc src/java/org/apache/cassandra/utils/FBUtilities.java
index 9df900d,69b7b5f..b560adf
--- a/src/java/org/apache/cassandra/utils/FBUtilities.java
+++ b/src/java/org/apache/cassandra/utils/FBUtilities.java
@@@ -896,12 -866,7 +896,12 @@@ public class FBUtilitie
          digest.update((byte)  ((val >>> 0) & 0xFF));
      }
  
 +    public static void updateWithBoolean(MessageDigest digest, boolean val)
 +    {
 +        updateWithByte(digest, val ? 0 : 1);
 +    }
 +
-     public static void closeAll(List<? extends AutoCloseable> l) throws 
Exception
+     public static void closeAll(Collection<? extends AutoCloseable> l) throws 
Exception
      {
          Exception toThrow = null;
          for (AutoCloseable c : l)
diff --cc test/unit/org/apache/cassandra/io/sstable/IndexSummaryManagerTest.java
index 9737281,385e88a..e86348b
--- a/test/unit/org/apache/cassandra/io/sstable/IndexSummaryManagerTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/IndexSummaryManagerTest.java
@@@ -22,6 -22,6 +22,7 @@@ import java.nio.ByteBuffer
  import java.util.*;
  import java.util.concurrent.*;
  import java.util.concurrent.atomic.AtomicReference;
++import java.util.function.Consumer;
  
  import com.google.common.base.Joiner;
  import com.google.common.collect.Sets;
@@@ -600,6 -592,34 +601,17 @@@ public class IndexSummaryManagerTes
      @Test
      public void testCancelIndex() throws Exception
      {
 -        testCancelIndexHelper(new CancelFunction()
 -        {
 -            public void cancel(ColumnFamilyStore cfs)
 -            {
 -                CompactionManager.instance.stopCompaction("INDEX_SUMMARY");
 -            }
 -        });
++        testCancelIndexHelper((cfs) -> 
CompactionManager.instance.stopCompaction("INDEX_SUMMARY"));
+     }
+ 
+     @Test
+     public void testCancelIndexInterrupt() throws Exception
+     {
 -        testCancelIndexHelper(new CancelFunction()
 -        {
 -            public void cancel(ColumnFamilyStore cfs)
 -            {
 -                
CompactionManager.instance.interruptCompactionFor(Collections.singleton(cfs.metadata),
 false);
 -            }
 -        });
 -    }
 -
 -    private static interface CancelFunction
 -    {
 -        void cancel(ColumnFamilyStore cfs);
++        testCancelIndexHelper((cfs) -> 
CompactionManager.instance.interruptCompactionFor(Collections.singleton(cfs.metadata),
 false));
+     }
+ 
 -    public void testCancelIndexHelper(CancelFunction cf) throws Exception
++    public void testCancelIndexHelper(Consumer<ColumnFamilyStore> 
cancelFunction) throws Exception
+     {
          String ksname = KEYSPACE1;
          String cfname = CF_STANDARDLOWiINTERVAL; // index interval of 8, no 
key caching
          Keyspace keyspace = Keyspace.open(ksname);
@@@ -649,7 -670,7 +661,7 @@@
          // to ensure that the stop condition check in 
IndexSummaryRedistribution::redistributeSummaries
          // is made *after* the halt request is made to the CompactionManager, 
don't allow the redistribution
          // to proceed until stopCompaction has been called.
-         CompactionManager.instance.stopCompaction("INDEX_SUMMARY");
 -        cf.cancel(cfs);
++        cancelFunction.accept(cfs);
          // allows the redistribution to proceed
          barrier.countDown();
          t.join();


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to