cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject [1/3] cassandra git commit: Log a message when a major compaction results in more than one sstable
Date Fri, 15 Jan 2016 08:42:44 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 58643b0af -> e0c27bcec


Log a message when a major compaction results in more than one sstable

Patch by marcuse; reviewed by Sylvain Lebresne for CASSANDRA-10847


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

Branch: refs/heads/cassandra-3.0
Commit: 03e6f450875173717014c2299915a10199307790
Parents: c42716f
Author: Marcus Eriksson <marcuse@apache.org>
Authored: Mon Dec 14 14:29:23 2015 +0100
Committer: Marcus Eriksson <marcuse@apache.org>
Committed: Fri Jan 15 09:22:30 2016 +0100

----------------------------------------------------------------------
 CHANGES.txt                                                    | 1 +
 .../org/apache/cassandra/db/compaction/CompactionManager.java  | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/03e6f450/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 74fd45b..636c15d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.13
+ * Log a message when major compaction does not result in a single file (CASSANDRA-10847)
  * (cqlsh) fix cqlsh_copy_tests when vnodes are disabled (CASSANDRA-10997)
  * (cqlsh) fix formatting bytearray values (CASSANDRA-10839)
  * (cqlsh) Add request timeout option to cqlsh (CASSANDRA-10686)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/03e6f450/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
index 30b8475..9e71ca0 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
@@ -534,9 +534,11 @@ public class CompactionManager implements CompactionManagerMBean
             return Collections.emptyList();
 
         List<Future<?>> futures = new ArrayList<>();
-
+        int nonEmptyTasks = 0;
         for (final AbstractCompactionTask task : tasks)
         {
+            if (task.sstables.size() > 0)
+                nonEmptyTasks++;
             Runnable runnable = new WrappedRunnable()
             {
                 protected void runMayThrow() throws IOException
@@ -551,6 +553,8 @@ public class CompactionManager implements CompactionManagerMBean
             }
             futures.add(executor.submit(runnable));
         }
+        if (nonEmptyTasks > 1)
+            logger.info("Cannot perform a full major compaction as repaired and unrepaired
sstables cannot be compacted together. These two set of sstables will be compacted separately.");
         return futures;
     }
 


Mime
View raw message