cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject [1/6] cassandra git commit: Abort or retry on failed hints delivery
Date Mon, 06 Feb 2017 20:02:34 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 cc384a5d7 -> dab0e31ba
  refs/heads/cassandra-3.11 8fc72a5eb -> 97861e68c
  refs/heads/trunk 217306669 -> 1757e1330


Abort or retry on failed hints delivery

patch by Stefan Podkowinski; reviewed by Paulo Motta for CASSANDRA-13124


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

Branch: refs/heads/cassandra-3.0
Commit: dab0e31ba0294ccc5e8af35cbbe0a6733f35794e
Parents: cc384a5
Author: Stefan Podkowinski <s.podkowinski@gmail.com>
Authored: Tue Jan 17 11:00:05 2017 +0100
Committer: Paulo Motta <paulo@apache.org>
Committed: Mon Feb 6 17:59:07 2017 -0200

----------------------------------------------------------------------
 CHANGES.txt                                              | 1 +
 src/java/org/apache/cassandra/hints/HintVerbHandler.java | 2 ++
 src/java/org/apache/cassandra/hints/HintsDispatcher.java | 9 +++------
 3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/dab0e31b/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 1d6b53c..1a90b1f 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.11
+ * Abort or retry on failed hints delivery (CASSANDRA-13124)
  * Fix handling of partition with partition-level deletion plus
    live rows in sstabledump (CASSANDRA-13177)
  * Provide user workaround when system_schema.columns does not contain entries

http://git-wip-us.apache.org/repos/asf/cassandra/blob/dab0e31b/src/java/org/apache/cassandra/hints/HintVerbHandler.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/hints/HintVerbHandler.java b/src/java/org/apache/cassandra/hints/HintVerbHandler.java
index abcd1f9..1fa479c 100644
--- a/src/java/org/apache/cassandra/hints/HintVerbHandler.java
+++ b/src/java/org/apache/cassandra/hints/HintVerbHandler.java
@@ -78,12 +78,14 @@ public final class HintVerbHandler implements IVerbHandler<HintMessage>
             // the node is not the final destination of the hint (must have gotten it from
a decommissioning node),
             // so just store it locally, to be delivered later.
             HintsService.instance.write(hostId, hint);
+            reply(id, message.from);
         }
         else if (!StorageProxy.instance.appliesLocally(hint.mutation))
         {
             // the topology has changed, and we are no longer a replica of the mutation -
since we don't know which node(s)
             // it has been handed over to, re-address the hint to all replicas; see CASSANDRA-5902.
             HintsService.instance.writeForAllReplicas(hint);
+            reply(id, message.from);
         }
         else
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/dab0e31b/src/java/org/apache/cassandra/hints/HintsDispatcher.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/hints/HintsDispatcher.java b/src/java/org/apache/cassandra/hints/HintsDispatcher.java
index e582d88..d7a3515 100644
--- a/src/java/org/apache/cassandra/hints/HintsDispatcher.java
+++ b/src/java/org/apache/cassandra/hints/HintsDispatcher.java
@@ -42,7 +42,7 @@ import org.apache.cassandra.utils.concurrent.SimpleCondition;
  */
 final class HintsDispatcher implements AutoCloseable
 {
-    private enum Action { CONTINUE, ABORT, RETRY }
+    private enum Action { CONTINUE, ABORT }
 
     private final HintsReader reader;
     private final UUID hostId;
@@ -116,10 +116,7 @@ final class HintsDispatcher implements AutoCloseable
     // retry in case of a timeout; stop in case of a failure, host going down, or delivery
paused
     private Action dispatch(HintsReader.Page page)
     {
-        Action action = sendHintsAndAwait(page);
-        return action == Action.RETRY
-             ? dispatch(page)
-             : action;
+        return sendHintsAndAwait(page);
     }
 
     private Action sendHintsAndAwait(HintsReader.Page page)
@@ -142,7 +139,7 @@ final class HintsDispatcher implements AutoCloseable
 
         for (Callback cb : callbacks)
             if (cb.await() != Callback.Outcome.SUCCESS)
-                return Action.RETRY;
+                return Action.ABORT;
 
         return Action.CONTINUE;
     }


Mime
View raw message