Merge branch 'cassandra-3.0' into cassandra-3.11

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

Branch: refs/heads/cassandra-3.11
Commit: cbc26d81d53822d16eb83052a69426e4f61f77ef
Parents: 60a2d97 d826c81
Author: Jason Brown <jasedbr...@gmail.com>
Authored: Wed Sep 13 06:29:42 2017 -0700
Committer: Jason Brown <jasedbr...@gmail.com>
Committed: Wed Sep 13 06:30:33 2017 -0700

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../commitlog/CommitLogSegmentManagerTest.java  | 30 ++++++++++++++++++++
 2 files changed, 31 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cbc26d81/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index ec9d126,4d2d5e7..b3fb5a6
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,14 -1,5 +1,15 @@@
 -3.0.15
 +3.11.1
 + * Add a compaction option to TWCS to ignore sstables overlapping checks 
(CASSANDRA-13418)
 + * BTree.Builder memory leak (CASSANDRA-13754)
 + * Revert CASSANDRA-10368 of supporting non-pk column filtering due to 
correctness (CASSANDRA-13798)
 + * Fix cassandra-stress hang issues when an error during cluster connection 
happens (CASSANDRA-12938)
 + * Better bootstrap failure message when blocked by (potential) range 
movement (CASSANDRA-13744)
 + * "ignore" option is ignored in sstableloader (CASSANDRA-13721)
 + * Deadlock in AbstractCommitLogSegmentManager (CASSANDRA-13652)
 + * Duplicate the buffer before passing it to analyser in SASI operation 
(CASSANDRA-13512)
 + * Properly evict pstmts from prepared statements cache (CASSANDRA-13641)
 +Merged from 3.0:
+  * Wait for all management tasks to complete before shutting down CLSM 
(CASSANDRA-13123)
   * INSERT statement fails when Tuple type is used as clustering column with 
default DESC order (CASSANDRA-13717)
   * Fix pending view mutations handling and cleanup batchlog when there are 
local and remote paired mutations (CASSANDRA-13069)
   * Improve config validation and documentation on overflow and NPE 
(CASSANDRA-13622)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cbc26d81/test/unit/org/apache/cassandra/db/commitlog/CommitLogSegmentManagerTest.java
----------------------------------------------------------------------
diff --cc 
test/unit/org/apache/cassandra/db/commitlog/CommitLogSegmentManagerTest.java
index e22e86f,41f5ed5..dfbf5ad
--- 
a/test/unit/org/apache/cassandra/db/commitlog/CommitLogSegmentManagerTest.java
+++ 
b/test/unit/org/apache/cassandra/db/commitlog/CommitLogSegmentManagerTest.java
@@@ -20,9 -20,10 +20,11 @@@
   */
  package org.apache.cassandra.db.commitlog;
  
+ import java.io.File;
  import java.nio.ByteBuffer;
 +import java.util.ArrayList;
  import java.util.Random;
+ import java.util.UUID;
  import java.util.concurrent.Semaphore;
  
  import com.google.common.collect.ImmutableMap;
@@@ -139,4 -136,32 +141,32 @@@ public class CommitLogSegmentManagerTes
              Thread.currentThread().interrupt();
          }
      }
+ 
+     @Test
+     @BMRule(name = "Make removing commitlog segments slow",
+             targetClass = "CommitLogSegment",
+             targetMethod = "discard",
+             action = "Thread.sleep(50)")
+     public void testShutdownWithPendingTasks() throws Throwable {
+         CommitLog.instance.resetUnsafe(true);
+         ColumnFamilyStore cfs1 = 
Keyspace.open(KEYSPACE1).getColumnFamilyStore(STANDARD1);
+ 
+         final Mutation m = new RowUpdateBuilder(cfs1.metadata, 0, "k")
+                            .clustering("bytes")
+                            .add("val", ByteBuffer.wrap(entropy))
+                            .build();
+ 
+         // force creating several commitlog files
+         for (int i = 0; i < 10; i++) {
+             CommitLog.instance.add(m);
+         }
+ 
+         // schedule discarding completed segments and immediately issue a 
shutdown
+         UUID cfid = m.getColumnFamilyIds().iterator().next();
 -        CommitLog.instance.discardCompletedSegments(cfid, 
ReplayPosition.NONE, CommitLog.instance.getContext());
++        CommitLog.instance.discardCompletedSegments(cfid, 
CommitLogPosition.NONE, CommitLog.instance.getCurrentPosition());
+         CommitLog.instance.shutdownBlocking();
+ 
+         // the shutdown should block until all logs except the currently 
active one and perhaps a new, empty one are gone
 -        Assert.assertTrue(new 
File(CommitLog.instance.location).listFiles().length <= 2);
++        Assert.assertTrue(new 
File(DatabaseDescriptor.getCommitLogLocation()).listFiles().length <= 2);
+     }
  }


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

Reply via email to