You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by st...@apache.org on 2017/01/04 07:10:37 UTC

[01/10] cassandra git commit: Fixed flacky SSTableRewriterTest: check file counts before calling validateCFS (CASSANDRA-12348)

Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 37e124e81 -> d2344683d
  refs/heads/cassandra-3.11 cac7364e7 -> e043d7d0b
  refs/heads/cassandra-3.X 04ee4ccb9 -> 342e28f69
  refs/heads/trunk a8a43dd32 -> d0e3ade8e


Fixed flacky SSTableRewriterTest: check file counts before calling validateCFS (CASSANDRA-12348)

patch by Stefania Alborghetti; reviewed by Paulo Motta for CASSANDRA-12348


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

Branch: refs/heads/cassandra-3.0
Commit: d2344683d3100168940230768c27206af2d75d95
Parents: 37e124e
Author: Stefania Alborghetti <st...@datastax.com>
Authored: Mon Aug 1 14:45:29 2016 +0800
Committer: Stefania Alborghetti <st...@datastax.com>
Committed: Wed Jan 4 08:04:52 2017 +0100

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../io/sstable/SSTableRewriterTest.java         | 12 ++++++------
 .../io/sstable/SSTableWriterTestBase.java       | 20 ++++++++++++++++++++
 3 files changed, 27 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d2344683/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 36c88c9..666a771 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.11
+ * Fixed flacky SSTableRewriterTest: check file counts before calling validateCFS (CASSANDRA-12348)
  * Fix deserialization of 2.x DeletedCells (CASSANDRA-12620)
  * Add parent repair session id to anticompaction log message (CASSANDRA-12186)
  * Improve contention handling on failure to acquire MV lock for streaming and hints (CASSANDRA-12905)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d2344683/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java b/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
index a7e822f..bdc3b42 100644
--- a/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
@@ -99,9 +99,9 @@ public class SSTableRewriterTest extends SSTableWriterTestBase
             writer.finish();
         }
         LifecycleTransaction.waitForDeletions();
+        assertEquals(1, assertFileCounts(sstables.iterator().next().descriptor.directory.list()));
+
         validateCFS(cfs);
-        int filecounts = assertFileCounts(sstables.iterator().next().descriptor.directory.list());
-        assertEquals(1, filecounts);
         truncate(cfs);
     }
     @Test
@@ -131,9 +131,9 @@ public class SSTableRewriterTest extends SSTableWriterTestBase
             writer.finish();
         }
         LifecycleTransaction.waitForDeletions();
+        assertEquals(1, assertFileCounts(sstables.iterator().next().descriptor.directory.list()));
+
         validateCFS(cfs);
-        int filecounts = assertFileCounts(sstables.iterator().next().descriptor.directory.list());
-        assertEquals(1, filecounts);
     }
 
     @Test
@@ -186,9 +186,9 @@ public class SSTableRewriterTest extends SSTableWriterTestBase
             writer.finish();
         }
         LifecycleTransaction.waitForDeletions();
+        assertEquals(1, assertFileCounts(sstables.iterator().next().descriptor.directory.list()));
+
         validateCFS(cfs);
-        int filecounts = assertFileCounts(sstables.iterator().next().descriptor.directory.list());
-        assertEquals(1, filecounts);
         truncate(cfs);
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d2344683/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java b/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java
index 5c7c7c0..26b1134 100644
--- a/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java
+++ b/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java
@@ -111,6 +111,25 @@ public class SSTableWriterTestBase extends SchemaLoader
         validateCFS(cfs);
     }
 
+    /**
+     * Validate the column family store by checking that all live
+     * sstables are referenced only once and are not marked as
+     * compacting. It also checks that the generation of the data
+     * files on disk is the same as that of the live sstables,
+     * to ensure that the data files on disk belong to the live
+     * sstables. Finally, it checks that the metrics contain the
+     * correct disk space used, live and total.
+     *
+     * Note that this method will submit a maximal compaction task
+     * if there are live sstables, in order to check that there is at least
+     * a maximal task when there are live sstables.
+     *
+     * This method has therefore side effects and should be called after
+     * performing any other checks on previous operations, especially
+     * checks involving files on disk.
+     *
+     * @param cfs - the column family store to validate
+     */
     public static void validateCFS(ColumnFamilyStore cfs)
     {
         Set<Integer> liveDescriptors = new HashSet<>();
@@ -136,6 +155,7 @@ public class SSTableWriterTestBase extends SchemaLoader
         assertEquals(spaceUsed, cfs.metric.liveDiskSpaceUsed.getCount());
         assertEquals(spaceUsed, cfs.metric.totalDiskSpaceUsed.getCount());
         assertTrue(cfs.getTracker().getCompacting().isEmpty());
+
         if(cfs.getLiveSSTables().size() > 0)
             assertFalse(CompactionManager.instance.submitMaximal(cfs, cfs.gcBefore((int) (System.currentTimeMillis() / 1000)), false).isEmpty());
     }


[10/10] cassandra git commit: Merge branch 'cassandra-3.X' into trunk

Posted by st...@apache.org.
Merge branch 'cassandra-3.X' into trunk


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

Branch: refs/heads/trunk
Commit: d0e3ade8e44a228e2800e89d0757c20a24f9955e
Parents: a8a43dd 342e28f
Author: Stefania Alborghetti <st...@datastax.com>
Authored: Wed Jan 4 08:08:45 2017 +0100
Committer: Stefania Alborghetti <st...@datastax.com>
Committed: Wed Jan 4 08:08:45 2017 +0100

----------------------------------------------------------------------

----------------------------------------------------------------------



[03/10] cassandra git commit: Fixed flacky SSTableRewriterTest: check file counts before calling validateCFS (CASSANDRA-12348)

Posted by st...@apache.org.
Fixed flacky SSTableRewriterTest: check file counts before calling validateCFS (CASSANDRA-12348)

patch by Stefania Alborghetti; reviewed by Paulo Motta for CASSANDRA-12348


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

Branch: refs/heads/cassandra-3.X
Commit: d2344683d3100168940230768c27206af2d75d95
Parents: 37e124e
Author: Stefania Alborghetti <st...@datastax.com>
Authored: Mon Aug 1 14:45:29 2016 +0800
Committer: Stefania Alborghetti <st...@datastax.com>
Committed: Wed Jan 4 08:04:52 2017 +0100

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../io/sstable/SSTableRewriterTest.java         | 12 ++++++------
 .../io/sstable/SSTableWriterTestBase.java       | 20 ++++++++++++++++++++
 3 files changed, 27 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d2344683/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 36c88c9..666a771 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.11
+ * Fixed flacky SSTableRewriterTest: check file counts before calling validateCFS (CASSANDRA-12348)
  * Fix deserialization of 2.x DeletedCells (CASSANDRA-12620)
  * Add parent repair session id to anticompaction log message (CASSANDRA-12186)
  * Improve contention handling on failure to acquire MV lock for streaming and hints (CASSANDRA-12905)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d2344683/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java b/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
index a7e822f..bdc3b42 100644
--- a/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
@@ -99,9 +99,9 @@ public class SSTableRewriterTest extends SSTableWriterTestBase
             writer.finish();
         }
         LifecycleTransaction.waitForDeletions();
+        assertEquals(1, assertFileCounts(sstables.iterator().next().descriptor.directory.list()));
+
         validateCFS(cfs);
-        int filecounts = assertFileCounts(sstables.iterator().next().descriptor.directory.list());
-        assertEquals(1, filecounts);
         truncate(cfs);
     }
     @Test
@@ -131,9 +131,9 @@ public class SSTableRewriterTest extends SSTableWriterTestBase
             writer.finish();
         }
         LifecycleTransaction.waitForDeletions();
+        assertEquals(1, assertFileCounts(sstables.iterator().next().descriptor.directory.list()));
+
         validateCFS(cfs);
-        int filecounts = assertFileCounts(sstables.iterator().next().descriptor.directory.list());
-        assertEquals(1, filecounts);
     }
 
     @Test
@@ -186,9 +186,9 @@ public class SSTableRewriterTest extends SSTableWriterTestBase
             writer.finish();
         }
         LifecycleTransaction.waitForDeletions();
+        assertEquals(1, assertFileCounts(sstables.iterator().next().descriptor.directory.list()));
+
         validateCFS(cfs);
-        int filecounts = assertFileCounts(sstables.iterator().next().descriptor.directory.list());
-        assertEquals(1, filecounts);
         truncate(cfs);
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d2344683/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java b/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java
index 5c7c7c0..26b1134 100644
--- a/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java
+++ b/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java
@@ -111,6 +111,25 @@ public class SSTableWriterTestBase extends SchemaLoader
         validateCFS(cfs);
     }
 
+    /**
+     * Validate the column family store by checking that all live
+     * sstables are referenced only once and are not marked as
+     * compacting. It also checks that the generation of the data
+     * files on disk is the same as that of the live sstables,
+     * to ensure that the data files on disk belong to the live
+     * sstables. Finally, it checks that the metrics contain the
+     * correct disk space used, live and total.
+     *
+     * Note that this method will submit a maximal compaction task
+     * if there are live sstables, in order to check that there is at least
+     * a maximal task when there are live sstables.
+     *
+     * This method has therefore side effects and should be called after
+     * performing any other checks on previous operations, especially
+     * checks involving files on disk.
+     *
+     * @param cfs - the column family store to validate
+     */
     public static void validateCFS(ColumnFamilyStore cfs)
     {
         Set<Integer> liveDescriptors = new HashSet<>();
@@ -136,6 +155,7 @@ public class SSTableWriterTestBase extends SchemaLoader
         assertEquals(spaceUsed, cfs.metric.liveDiskSpaceUsed.getCount());
         assertEquals(spaceUsed, cfs.metric.totalDiskSpaceUsed.getCount());
         assertTrue(cfs.getTracker().getCompacting().isEmpty());
+
         if(cfs.getLiveSSTables().size() > 0)
             assertFalse(CompactionManager.instance.submitMaximal(cfs, cfs.gcBefore((int) (System.currentTimeMillis() / 1000)), false).isEmpty());
     }


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

Posted by st...@apache.org.
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/e043d7d0
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e043d7d0
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e043d7d0

Branch: refs/heads/trunk
Commit: e043d7d0bfa5416a8e16646f8cafed91768f635e
Parents: cac7364 d234468
Author: Stefania Alborghetti <st...@datastax.com>
Authored: Wed Jan 4 08:07:52 2017 +0100
Committer: Stefania Alborghetti <st...@datastax.com>
Committed: Wed Jan 4 08:07:52 2017 +0100

----------------------------------------------------------------------

----------------------------------------------------------------------



[02/10] cassandra git commit: Fixed flacky SSTableRewriterTest: check file counts before calling validateCFS (CASSANDRA-12348)

Posted by st...@apache.org.
Fixed flacky SSTableRewriterTest: check file counts before calling validateCFS (CASSANDRA-12348)

patch by Stefania Alborghetti; reviewed by Paulo Motta for CASSANDRA-12348


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

Branch: refs/heads/cassandra-3.11
Commit: d2344683d3100168940230768c27206af2d75d95
Parents: 37e124e
Author: Stefania Alborghetti <st...@datastax.com>
Authored: Mon Aug 1 14:45:29 2016 +0800
Committer: Stefania Alborghetti <st...@datastax.com>
Committed: Wed Jan 4 08:04:52 2017 +0100

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../io/sstable/SSTableRewriterTest.java         | 12 ++++++------
 .../io/sstable/SSTableWriterTestBase.java       | 20 ++++++++++++++++++++
 3 files changed, 27 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d2344683/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 36c88c9..666a771 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.11
+ * Fixed flacky SSTableRewriterTest: check file counts before calling validateCFS (CASSANDRA-12348)
  * Fix deserialization of 2.x DeletedCells (CASSANDRA-12620)
  * Add parent repair session id to anticompaction log message (CASSANDRA-12186)
  * Improve contention handling on failure to acquire MV lock for streaming and hints (CASSANDRA-12905)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d2344683/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java b/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
index a7e822f..bdc3b42 100644
--- a/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
@@ -99,9 +99,9 @@ public class SSTableRewriterTest extends SSTableWriterTestBase
             writer.finish();
         }
         LifecycleTransaction.waitForDeletions();
+        assertEquals(1, assertFileCounts(sstables.iterator().next().descriptor.directory.list()));
+
         validateCFS(cfs);
-        int filecounts = assertFileCounts(sstables.iterator().next().descriptor.directory.list());
-        assertEquals(1, filecounts);
         truncate(cfs);
     }
     @Test
@@ -131,9 +131,9 @@ public class SSTableRewriterTest extends SSTableWriterTestBase
             writer.finish();
         }
         LifecycleTransaction.waitForDeletions();
+        assertEquals(1, assertFileCounts(sstables.iterator().next().descriptor.directory.list()));
+
         validateCFS(cfs);
-        int filecounts = assertFileCounts(sstables.iterator().next().descriptor.directory.list());
-        assertEquals(1, filecounts);
     }
 
     @Test
@@ -186,9 +186,9 @@ public class SSTableRewriterTest extends SSTableWriterTestBase
             writer.finish();
         }
         LifecycleTransaction.waitForDeletions();
+        assertEquals(1, assertFileCounts(sstables.iterator().next().descriptor.directory.list()));
+
         validateCFS(cfs);
-        int filecounts = assertFileCounts(sstables.iterator().next().descriptor.directory.list());
-        assertEquals(1, filecounts);
         truncate(cfs);
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d2344683/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java b/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java
index 5c7c7c0..26b1134 100644
--- a/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java
+++ b/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java
@@ -111,6 +111,25 @@ public class SSTableWriterTestBase extends SchemaLoader
         validateCFS(cfs);
     }
 
+    /**
+     * Validate the column family store by checking that all live
+     * sstables are referenced only once and are not marked as
+     * compacting. It also checks that the generation of the data
+     * files on disk is the same as that of the live sstables,
+     * to ensure that the data files on disk belong to the live
+     * sstables. Finally, it checks that the metrics contain the
+     * correct disk space used, live and total.
+     *
+     * Note that this method will submit a maximal compaction task
+     * if there are live sstables, in order to check that there is at least
+     * a maximal task when there are live sstables.
+     *
+     * This method has therefore side effects and should be called after
+     * performing any other checks on previous operations, especially
+     * checks involving files on disk.
+     *
+     * @param cfs - the column family store to validate
+     */
     public static void validateCFS(ColumnFamilyStore cfs)
     {
         Set<Integer> liveDescriptors = new HashSet<>();
@@ -136,6 +155,7 @@ public class SSTableWriterTestBase extends SchemaLoader
         assertEquals(spaceUsed, cfs.metric.liveDiskSpaceUsed.getCount());
         assertEquals(spaceUsed, cfs.metric.totalDiskSpaceUsed.getCount());
         assertTrue(cfs.getTracker().getCompacting().isEmpty());
+
         if(cfs.getLiveSSTables().size() > 0)
             assertFalse(CompactionManager.instance.submitMaximal(cfs, cfs.gcBefore((int) (System.currentTimeMillis() / 1000)), false).isEmpty());
     }


[05/10] cassandra git commit: Merge branch 'cassandra-3.0' into cassandra-3.11

Posted by st...@apache.org.
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/e043d7d0
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e043d7d0
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e043d7d0

Branch: refs/heads/cassandra-3.X
Commit: e043d7d0bfa5416a8e16646f8cafed91768f635e
Parents: cac7364 d234468
Author: Stefania Alborghetti <st...@datastax.com>
Authored: Wed Jan 4 08:07:52 2017 +0100
Committer: Stefania Alborghetti <st...@datastax.com>
Committed: Wed Jan 4 08:07:52 2017 +0100

----------------------------------------------------------------------

----------------------------------------------------------------------



[08/10] cassandra git commit: Merge branch 'cassandra-3.11' into cassandra-3.X

Posted by st...@apache.org.
Merge branch 'cassandra-3.11' into cassandra-3.X


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

Branch: refs/heads/cassandra-3.X
Commit: 342e28f695294a2afdde4fbe4faa42f8c0ebad76
Parents: 04ee4cc e043d7d
Author: Stefania Alborghetti <st...@datastax.com>
Authored: Wed Jan 4 08:08:31 2017 +0100
Committer: Stefania Alborghetti <st...@datastax.com>
Committed: Wed Jan 4 08:08:31 2017 +0100

----------------------------------------------------------------------

----------------------------------------------------------------------



[09/10] cassandra git commit: Merge branch 'cassandra-3.11' into cassandra-3.X

Posted by st...@apache.org.
Merge branch 'cassandra-3.11' into cassandra-3.X


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

Branch: refs/heads/trunk
Commit: 342e28f695294a2afdde4fbe4faa42f8c0ebad76
Parents: 04ee4cc e043d7d
Author: Stefania Alborghetti <st...@datastax.com>
Authored: Wed Jan 4 08:08:31 2017 +0100
Committer: Stefania Alborghetti <st...@datastax.com>
Committed: Wed Jan 4 08:08:31 2017 +0100

----------------------------------------------------------------------

----------------------------------------------------------------------



[04/10] cassandra git commit: Fixed flacky SSTableRewriterTest: check file counts before calling validateCFS (CASSANDRA-12348)

Posted by st...@apache.org.
Fixed flacky SSTableRewriterTest: check file counts before calling validateCFS (CASSANDRA-12348)

patch by Stefania Alborghetti; reviewed by Paulo Motta for CASSANDRA-12348


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

Branch: refs/heads/trunk
Commit: d2344683d3100168940230768c27206af2d75d95
Parents: 37e124e
Author: Stefania Alborghetti <st...@datastax.com>
Authored: Mon Aug 1 14:45:29 2016 +0800
Committer: Stefania Alborghetti <st...@datastax.com>
Committed: Wed Jan 4 08:04:52 2017 +0100

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../io/sstable/SSTableRewriterTest.java         | 12 ++++++------
 .../io/sstable/SSTableWriterTestBase.java       | 20 ++++++++++++++++++++
 3 files changed, 27 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d2344683/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 36c88c9..666a771 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.11
+ * Fixed flacky SSTableRewriterTest: check file counts before calling validateCFS (CASSANDRA-12348)
  * Fix deserialization of 2.x DeletedCells (CASSANDRA-12620)
  * Add parent repair session id to anticompaction log message (CASSANDRA-12186)
  * Improve contention handling on failure to acquire MV lock for streaming and hints (CASSANDRA-12905)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d2344683/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java b/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
index a7e822f..bdc3b42 100644
--- a/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
@@ -99,9 +99,9 @@ public class SSTableRewriterTest extends SSTableWriterTestBase
             writer.finish();
         }
         LifecycleTransaction.waitForDeletions();
+        assertEquals(1, assertFileCounts(sstables.iterator().next().descriptor.directory.list()));
+
         validateCFS(cfs);
-        int filecounts = assertFileCounts(sstables.iterator().next().descriptor.directory.list());
-        assertEquals(1, filecounts);
         truncate(cfs);
     }
     @Test
@@ -131,9 +131,9 @@ public class SSTableRewriterTest extends SSTableWriterTestBase
             writer.finish();
         }
         LifecycleTransaction.waitForDeletions();
+        assertEquals(1, assertFileCounts(sstables.iterator().next().descriptor.directory.list()));
+
         validateCFS(cfs);
-        int filecounts = assertFileCounts(sstables.iterator().next().descriptor.directory.list());
-        assertEquals(1, filecounts);
     }
 
     @Test
@@ -186,9 +186,9 @@ public class SSTableRewriterTest extends SSTableWriterTestBase
             writer.finish();
         }
         LifecycleTransaction.waitForDeletions();
+        assertEquals(1, assertFileCounts(sstables.iterator().next().descriptor.directory.list()));
+
         validateCFS(cfs);
-        int filecounts = assertFileCounts(sstables.iterator().next().descriptor.directory.list());
-        assertEquals(1, filecounts);
         truncate(cfs);
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d2344683/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java b/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java
index 5c7c7c0..26b1134 100644
--- a/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java
+++ b/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java
@@ -111,6 +111,25 @@ public class SSTableWriterTestBase extends SchemaLoader
         validateCFS(cfs);
     }
 
+    /**
+     * Validate the column family store by checking that all live
+     * sstables are referenced only once and are not marked as
+     * compacting. It also checks that the generation of the data
+     * files on disk is the same as that of the live sstables,
+     * to ensure that the data files on disk belong to the live
+     * sstables. Finally, it checks that the metrics contain the
+     * correct disk space used, live and total.
+     *
+     * Note that this method will submit a maximal compaction task
+     * if there are live sstables, in order to check that there is at least
+     * a maximal task when there are live sstables.
+     *
+     * This method has therefore side effects and should be called after
+     * performing any other checks on previous operations, especially
+     * checks involving files on disk.
+     *
+     * @param cfs - the column family store to validate
+     */
     public static void validateCFS(ColumnFamilyStore cfs)
     {
         Set<Integer> liveDescriptors = new HashSet<>();
@@ -136,6 +155,7 @@ public class SSTableWriterTestBase extends SchemaLoader
         assertEquals(spaceUsed, cfs.metric.liveDiskSpaceUsed.getCount());
         assertEquals(spaceUsed, cfs.metric.totalDiskSpaceUsed.getCount());
         assertTrue(cfs.getTracker().getCompacting().isEmpty());
+
         if(cfs.getLiveSSTables().size() > 0)
             assertFalse(CompactionManager.instance.submitMaximal(cfs, cfs.gcBefore((int) (System.currentTimeMillis() / 1000)), false).isEmpty());
     }


[06/10] cassandra git commit: Merge branch 'cassandra-3.0' into cassandra-3.11

Posted by st...@apache.org.
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/e043d7d0
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e043d7d0
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e043d7d0

Branch: refs/heads/cassandra-3.11
Commit: e043d7d0bfa5416a8e16646f8cafed91768f635e
Parents: cac7364 d234468
Author: Stefania Alborghetti <st...@datastax.com>
Authored: Wed Jan 4 08:07:52 2017 +0100
Committer: Stefania Alborghetti <st...@datastax.com>
Committed: Wed Jan 4 08:07:52 2017 +0100

----------------------------------------------------------------------

----------------------------------------------------------------------