You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ma...@apache.org on 2017/09/04 13:05:19 UTC

[07/10] cassandra git commit: Merge branch 'cassandra-2.2' into cassandra-3.0

Merge branch 'cassandra-2.2' into cassandra-3.0


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b0eba5f9
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b0eba5f9
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b0eba5f9

Branch: refs/heads/trunk
Commit: b0eba5f9c64db18840a4b0e4d56a589c5f2e08cd
Parents: f791c26 e80ede6
Author: Marcus Eriksson <ma...@apache.org>
Authored: Mon Sep 4 15:02:53 2017 +0200
Committer: Marcus Eriksson <ma...@apache.org>
Committed: Mon Sep 4 15:02:53 2017 +0200

----------------------------------------------------------------------
 CHANGES.txt                                     |   1 +
 .../apache/cassandra/db/ColumnFamilyStore.java  |   2 +-
 .../db/compaction/CompactionManager.java        |   4 +-
 .../db/compaction/CompactionExecutorTest.java   | 107 +++++++++++++++++++
 4 files changed, 111 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b0eba5f9/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index b405fdf,03a78fd..3baa63b
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,37 -1,8 +1,38 @@@
 -2.2.11
 +3.0.15
 + * Better tolerate improperly formatted bcrypt hashes (CASSANDRA-13626) 
 + * Fix race condition in read command serialization (CASSANDRA-13363)
 + * Enable segement creation before recovering commitlogs (CASSANDRA-13587)
 + * Fix AssertionError in short read protection (CASSANDRA-13747)
 + * Don't skip corrupted sstables on startup (CASSANDRA-13620)
 + * Fix the merging of cells with different user type versions (CASSANDRA-13776)
 + * Copy session properties on cqlsh.py do_login (CASSANDRA-13640)
 + * Potential AssertionError during ReadRepair of range tombstone and partition deletions (CASSANDRA-13719)
 + * Don't let stress write warmup data if n=0 (CASSANDRA-13773)
 + * Gossip thread slows down when using batch commit log (CASSANDRA-12966)
 + * Randomize batchlog endpoint selection with only 1 or 2 racks (CASSANDRA-12884)
 + * Fix digest calculation for counter cells (CASSANDRA-13750)
 + * Fix ColumnDefinition.cellValueType() for non-frozen collection and change SSTabledump to use type.toJSONString() (CASSANDRA-13573)
 + * Skip materialized view addition if the base table doesn't exist (CASSANDRA-13737)
 + * Drop table should remove corresponding entries in dropped_columns table (CASSANDRA-13730)
 + * Log warn message until legacy auth tables have been migrated (CASSANDRA-13371)
 + * Fix incorrect [2.1 <- 3.0] serialization of counter cells created in 2.0 (CASSANDRA-13691)
 + * Fix invalid writetime for null cells (CASSANDRA-13711)
 + * Fix ALTER TABLE statement to atomically propagate changes to the table and its MVs (CASSANDRA-12952)
 + * Fixed ambiguous output of nodetool tablestats command (CASSANDRA-13722)
 + * JMXEnabledThreadPoolExecutor with corePoolSize equal to maxPoolSize (Backport CASSANDRA-13329)
 + * Fix Digest mismatch Exception if hints file has UnknownColumnFamily (CASSANDRA-13696)
 + * Purge tombstones created by expired cells (CASSANDRA-13643)
 + * Make concat work with iterators that have different subsets of columns (CASSANDRA-13482)
 + * Set test.runners based on cores and memory size (CASSANDRA-13078)
 + * Allow different NUMACTL_ARGS to be passed in (CASSANDRA-13557)
 + * Allow native function calls in CQLSSTableWriter (CASSANDRA-12606)
 + * Fix secondary index queries on COMPACT tables (CASSANDRA-13627)
 + * Nodetool listsnapshots output is missing a newline, if there are no snapshots (CASSANDRA-13568)
 + * sstabledump reports incorrect usage for argument order (CASSANDRA-13532)
 +Merged from 2.2:
+  * Fix compaction and flush exception not captured (CASSANDRA-13833)
 - * Make BatchlogManagerMBean.forceBatchlogReplay() blocking (CASSANDRA-13809)
   * Uncaught exceptions in Netty pipeline (CASSANDRA-13649)
 - * Prevent integer overflow on exabyte filesystems (CASSANDRA-13067) 
 + * Prevent integer overflow on exabyte filesystems (CASSANDRA-13067)
   * Fix queries with LIMIT and filtering on clustering columns (CASSANDRA-11223)
   * Fix potential NPE when resume bootstrap fails (CASSANDRA-13272)
   * Fix toJSONString for the UDT, tuple and collection types (CASSANDRA-13592)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b0eba5f9/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index 7251244,7e36e11..183176c
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@@ -837,12 -899,33 +837,12 @@@ public class ColumnFamilyStore implemen
      {
          synchronized (data)
          {
 -            if (previousFlushFailure != null)
 -                throw new IllegalStateException("A flush previously failed with the error below. To prevent data loss, "
 -                                              + "no flushes can be carried out until the node is restarted.",
 -                                                previousFlushFailure);
              logFlush();
              Flush flush = new Flush(false);
 -            ListenableFutureTask<Void> flushTask = ListenableFutureTask.create(flush, null);
 -            flushExecutor.execute(flushTask);
 +            flushExecutor.execute(flush);
              ListenableFutureTask<ReplayPosition> task = ListenableFutureTask.create(flush.postFlush);
-             postFlushExecutor.submit(task);
+             postFlushExecutor.execute(task);
 -
 -            @SuppressWarnings("unchecked")
 -            ListenableFuture<ReplayPosition> future = 
 -                    // If either of the two tasks errors out, resulting future must also error out.
 -                    // Combine the two futures and only return post-flush result after both have completed.
 -                    // Note that flushTask will always yield null, but Futures.allAsList is
 -                    // order preserving, which is why the transform function returns the result
 -                    // from item 1 in it's input list (i.e. what was yielded by task).
 -                    Futures.transform(Futures.allAsList(flushTask, task),
 -                                      new Function<List<Object>, ReplayPosition>()
 -                                      {
 -                                          public ReplayPosition apply(List<Object> input)
 -                                          {
 -                                              return (ReplayPosition) input.get(1);
 -                                          }
 -                                      });
 -            return future;
 +            return task;
          }
      }
  

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b0eba5f9/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b0eba5f9/test/unit/org/apache/cassandra/db/compaction/CompactionExecutorTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/db/compaction/CompactionExecutorTest.java
index 0000000,c6feb3f..9b07da9
mode 000000,100644..100644
--- a/test/unit/org/apache/cassandra/db/compaction/CompactionExecutorTest.java
+++ b/test/unit/org/apache/cassandra/db/compaction/CompactionExecutorTest.java
@@@ -1,0 -1,131 +1,107 @@@
+ /*
+  * Licensed to the Apache Software Foundation (ASF) under one
+  * or more contributor license agreements.  See the NOTICE file
+  * distributed with this work for additional information
+  * regarding copyright ownership.  The ASF licenses this file
+  * to you under the Apache License, Version 2.0 (the
+  * "License"); you may not use this file except in compliance
+  * with the License.  You may obtain a copy of the License at
+  *
+  *     http://www.apache.org/licenses/LICENSE-2.0
+  *
+  * Unless required by applicable law or agreed to in writing, software
+  * distributed under the License is distributed on an "AS IS" BASIS,
+  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  * See the License for the specific language governing permissions and
+  * limitations under the License.
+  */
+ 
+ package org.apache.cassandra.db.compaction;
+ 
 -import java.util.concurrent.Callable;
+ import java.util.concurrent.Future;
+ import java.util.concurrent.TimeUnit;
+ 
+ import org.junit.After;
+ import org.junit.Before;
+ import org.junit.Test;
+ import org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor;
+ 
+ import static org.junit.Assert.assertEquals;
+ import static org.junit.Assert.assertNotNull;
+ 
+ public class CompactionExecutorTest
+ {
+     static Throwable testTaskThrowable = null;
+     private static class TestTaskExecutor extends CompactionManager.CompactionExecutor
+     {
+         @Override
+         public void afterExecute(Runnable r, Throwable t)
+         {
+             if (t == null)
+             {
+                 t = DebuggableThreadPoolExecutor.extractThrowable(r);
+             }
+             testTaskThrowable = t;
+         }
+         @Override
+         protected void beforeExecute(Thread t, Runnable r)
+         {
+         }
+     }
+     private CompactionManager.CompactionExecutor executor;
+ 
+     @Before
+     public void setup()
+     {
+         executor = new TestTaskExecutor();
+     }
+ 
+     @After
+     public void destroy() throws Exception
+     {
+         executor.shutdown();
+         executor.awaitTermination(1, TimeUnit.MINUTES);
+     }
+ 
+     @Test
+     public void testFailedRunnable() throws Exception
+     {
+         testTaskThrowable = null;
 -
+         Future<?> tt = executor.submitIfRunning(
 -            new Runnable()
 -            {
 -                @Override
 -                public void run()
 -                {
 -                    assert false : "testFailedRunnable";
 -                }
 -            }, "compactionExecutorTest"
 -        );
++            () -> { assert false : "testFailedRunnable"; }
++            , "compactionExecutorTest");
+ 
+         while (!tt.isDone())
+             Thread.sleep(10);
+         assertNotNull(testTaskThrowable);
+         assertEquals(testTaskThrowable.getMessage(), "testFailedRunnable");
+     }
+ 
+     @Test
+     public void testFailedCallable() throws Exception
+     {
+         testTaskThrowable = null;
+         Future<?> tt = executor.submitIfRunning(
 -            new Callable<Integer>()
 -            {
 -                @Override
 -                public Integer call() throws Exception
 -                {
 -                    assert false : "testFailedCallable";
 -                    return 1;
 -                }
 -            }
++            () -> { assert false : "testFailedCallable"; return 1; }
+             , "compactionExecutorTest");
+ 
+         while (!tt.isDone())
+             Thread.sleep(10);
+         assertNotNull(testTaskThrowable);
+         assertEquals(testTaskThrowable.getMessage(), "testFailedCallable");
+     }
+ 
+     @Test
+     public void testExceptionRunnable() throws Exception
+     {
+         testTaskThrowable = null;
+         Future<?> tt = executor.submitIfRunning(
 -        new Runnable()
 -        {
 -            @Override
 -            public void run()
 -            {
 -                throw new RuntimeException("testExceptionRunnable");
 -            }
 -        }
++        () -> { throw new RuntimeException("testExceptionRunnable"); }
+         , "compactionExecutorTest");
+ 
+         while (!tt.isDone())
+             Thread.sleep(10);
+         assertNotNull(testTaskThrowable);
+         assertEquals(testTaskThrowable.getMessage(), "testExceptionRunnable");
+     }
+ }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org