cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasobr...@apache.org
Subject [6/6] cassandra git commit: Merge branch 'cassandra-3.11' into trunk
Date Wed, 13 Sep 2017 13:37:08 GMT
Merge branch 'cassandra-3.11' into trunk


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

Branch: refs/heads/trunk
Commit: e7e936735df8e0fdd7e7d0df92d7bd60c4602648
Parents: 2b57fb6 cbc26d8
Author: Jason Brown <jasedbrown@gmail.com>
Authored: Wed Sep 13 06:30:50 2017 -0700
Committer: Jason Brown <jasedbrown@gmail.com>
Committed: Wed Sep 13 06:31:37 2017 -0700

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e7e93673/CHANGES.txt
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e7e93673/test/unit/org/apache/cassandra/db/commitlog/CommitLogSegmentManagerTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/db/commitlog/CommitLogSegmentManagerTest.java
index 06513a5,dfbf5ad..5db7149
--- a/test/unit/org/apache/cassandra/db/commitlog/CommitLogSegmentManagerTest.java
+++ b/test/unit/org/apache/cassandra/db/commitlog/CommitLogSegmentManagerTest.java
@@@ -44,6 -46,6 +46,7 @@@ import org.apache.cassandra.db.compacti
  import org.apache.cassandra.db.marshal.AsciiType;
  import org.apache.cassandra.db.marshal.BytesType;
  import org.apache.cassandra.schema.KeyspaceParams;
++import org.apache.cassandra.schema.TableId;
  import org.jboss.byteman.contrib.bmunit.BMRule;
  import org.jboss.byteman.contrib.bmunit.BMRules;
  import org.jboss.byteman.contrib.bmunit.BMUnitRunner;
@@@ -139,4 -141,32 +142,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")
++        final Mutation m = new RowUpdateBuilder(cfs1.metadata.get(), 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, CommitLogPosition.NONE, CommitLog.instance.getCurrentPosition());
++        TableId tableId = m.getTableIds().iterator().next();
++        CommitLog.instance.discardCompletedSegments(tableId, 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(DatabaseDescriptor.getCommitLogLocation()).listFiles().length
<= 2);
+     }
  }


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


Mime
View raw message