cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasobr...@apache.org
Subject git commit: Anti-compaction proceeds if any part of the repair failed
Date Tue, 08 Jul 2014 23:21:55 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1.0 895eaecc3 -> eb4032e5f


Anti-compaction proceeds if any part of the repair failed

patch by jasobrown; reviewed by yukim for CASSANDRA-7521


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

Branch: refs/heads/cassandra-2.1.0
Commit: eb4032e5fb4b5c7ec4f59989c0e62ebc431c1e21
Parents: 895eaec
Author: Jason Brown <jasobrown@apple.com>
Authored: Tue Jul 8 16:20:58 2014 -0700
Committer: Jason Brown <jasobrown@apple.com>
Committed: Tue Jul 8 16:20:58 2014 -0700

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../cassandra/service/ActiveRepairService.java  | 22 +++++++++++---------
 .../cassandra/service/StorageService.java       |  5 ++++-
 3 files changed, 17 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/eb4032e5/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 180b044..7fff2d4 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,6 @@
 2.1.0-final
  * (Windows) fix startup when WMI memory query fails (CASSANDRA-7505)
+ * Anti-compaction proceeds if any part of the repair failed (CASANDRA-7521)
 
 
 2.1.0-rc3

http://git-wip-us.apache.org/repos/asf/cassandra/blob/eb4032e5/src/java/org/apache/cassandra/service/ActiveRepairService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/ActiveRepairService.java b/src/java/org/apache/cassandra/service/ActiveRepairService.java
index 70394bc..35a86f6 100644
--- a/src/java/org/apache/cassandra/service/ActiveRepairService.java
+++ b/src/java/org/apache/cassandra/service/ActiveRepairService.java
@@ -316,19 +316,21 @@ public class ActiveRepairService
         parentRepairSessions.put(parentRepairSession, new ParentRepairSession(columnFamilyStores,
ranges, sstablesToRepair, System.currentTimeMillis()));
     }
 
-    public void finishParentSession(UUID parentSession, Set<InetAddress> neighbors)
throws InterruptedException, ExecutionException, IOException
+    public void finishParentSession(UUID parentSession, Set<InetAddress> neighbors,
boolean doAntiCompaction) throws InterruptedException, ExecutionException, IOException
     {
-
-        for (InetAddress neighbor : neighbors)
-        {
-            AnticompactionRequest acr = new AnticompactionRequest(parentSession);
-            MessageOut<RepairMessage> req = acr.createMessage();
-            MessagingService.instance().sendOneWay(req, neighbor);
-        }
         try
         {
-            List<Future<?>> futures = doAntiCompaction(parentSession);
-            FBUtilities.waitOnFutures(futures);
+            if (doAntiCompaction)
+            {
+                for (InetAddress neighbor : neighbors)
+                {
+                    AnticompactionRequest acr = new AnticompactionRequest(parentSession);
+                    MessageOut<RepairMessage> req = acr.createMessage();
+                    MessagingService.instance().sendOneWay(req, neighbor);
+                }
+                List<Future<?>> futures = doAntiCompaction(parentSession);
+                FBUtilities.waitOnFutures(futures);
+            }
         }
         finally
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/eb4032e5/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index feaeac8..3fd3781 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -2765,6 +2765,7 @@ public class StorageService extends NotificationBroadcasterSupport implements
IE
                     }
                 }
 
+                boolean successful = true;
                 for (RepairFuture future : futures)
                 {
                     try
@@ -2776,19 +2777,21 @@ public class StorageService extends NotificationBroadcasterSupport
implements IE
                     }
                     catch (ExecutionException e)
                     {
+                        successful = false;
                         message = String.format("Repair session %s for range %s failed with
error %s", future.session.getId(), future.session.getRange().toString(), e.getCause().getMessage());
                         logger.error(message, e);
                         sendNotification("repair", message, new int[]{cmd, ActiveRepairService.Status.SESSION_FAILED.ordinal()});
                     }
                     catch (Exception e)
                     {
+                        successful = false;
                         message = String.format("Repair session %s for range %s failed with
error %s", future.session.getId(), future.session.getRange().toString(), e.getMessage());
                         logger.error(message, e);
                         sendNotification("repair", message, new int[]{cmd, ActiveRepairService.Status.SESSION_FAILED.ordinal()});
                     }
                 }
                 if (!fullRepair)
-                    ActiveRepairService.instance.finishParentSession(parentSession, allNeighbors);
+                    ActiveRepairService.instance.finishParentSession(parentSession, allNeighbors,
successful);
                 sendNotification("repair", String.format("Repair command #%d finished", cmd),
new int[]{cmd, ActiveRepairService.Status.FINISHED.ordinal()});
             }
         }, null);


Mime
View raw message