cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject [3/6] cassandra git commit: Better error message for cleanup
Date Thu, 18 Feb 2016 11:53:45 GMT
Better error message for cleanup

Patch by marcuse; reviewed by Carl Yeksigian for CASSANDRA-10991


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

Branch: refs/heads/trunk
Commit: c00395155e2420002db493ca69784d0fe723b55d
Parents: 128d144
Author: Marcus Eriksson <marcuse@apache.org>
Authored: Thu Feb 18 12:49:30 2016 +0100
Committer: Marcus Eriksson <marcuse@apache.org>
Committed: Thu Feb 18 12:50:31 2016 +0100

----------------------------------------------------------------------
 CHANGES.txt                                                 | 1 +
 .../apache/cassandra/db/compaction/CompactionManager.java   | 9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c0039515/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 904a913..7cbfea7 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.2.6
+ * Better error message for cleanup (CASSANDRA-10991)
  * cqlsh pg-style-strings broken if line ends with ';' (CASSANDRA-11123)
  * Use cloned TokenMetadata in size estimates to avoid race against membership check
    (CASSANDRA-10736)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c0039515/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 8ca9852..44d7efb 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
@@ -401,12 +401,17 @@ public class CompactionManager implements CompactionManagerMBean
     {
         assert !cfStore.isIndex();
         Keyspace keyspace = cfStore.keyspace;
-        final Collection<Range<Token>> ranges = StorageService.instance.getLocalRanges(keyspace.getName());
-        if (ranges.isEmpty())
+        if (!StorageService.instance.isJoined())
         {
             logger.info("Cleanup cannot run before a node has joined the ring");
             return AllSSTableOpStatus.ABORTED;
         }
+        final Collection<Range<Token>> ranges = StorageService.instance.getLocalRanges(keyspace.getName());
+        if (ranges.isEmpty())
+        {
+            logger.info("Node owns no data for keyspace {}", keyspace.getName());
+            return AllSSTableOpStatus.SUCCESSFUL;
+        }
         final boolean hasIndexes = cfStore.indexManager.hasIndexes();
 
         return parallelAllSSTableOperation(cfStore, new OneSSTableOperation()


Mime
View raw message