cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [1/2] cassandra git commit: Fix Verb.BATCHLOG_MUTATION usages in StorageProxy
Date Thu, 06 Aug 2015 14:44:15 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk c35bfc09c -> 414685381


Fix Verb.BATCHLOG_MUTATION usages in StorageProxy

patch by Carl Yeksigian; reviewed by Aleksey Yeschenko for
CASSANDRA-9992


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

Branch: refs/heads/trunk
Commit: 16498de42d1e173f39d7edeba5ab7d567e609cc6
Parents: 762db47
Author: Carl Yeksigian <carl@apache.org>
Authored: Wed Aug 5 11:42:01 2015 -0400
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Thu Aug 6 17:42:45 2015 +0300

----------------------------------------------------------------------
 .../apache/cassandra/service/StorageProxy.java  | 24 +++++++++++++++-----
 1 file changed, 18 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/16498de4/src/java/org/apache/cassandra/service/StorageProxy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageProxy.java b/src/java/org/apache/cassandra/service/StorageProxy.java
index b637b17..2c3c018 100644
--- a/src/java/org/apache/cassandra/service/StorageProxy.java
+++ b/src/java/org/apache/cassandra/service/StorageProxy.java
@@ -837,18 +837,18 @@ public class StorageProxy implements StorageProxyMBean
             {
                 insertLocal(Stage.BATCHLOG_MUTATION, message.payload, handler);
             }
-            else if (targetVersion == MessagingService.current_version)
-            {
-                MessagingService.instance().sendRR(message, target, handler, false);
-            }
-            else
+            else if (targetVersion < MessagingService.VERSION_30)
             {
                 MessagingService.instance().sendRR(BatchlogManager.getBatchlogMutationFor(mutations,
uuid, targetVersion)
-                                                                  .createMessage(MessagingService.Verb.BATCHLOG_MUTATION),
+                                                                  .createMessage(MessagingService.Verb.MUTATION),
                                                    target,
                                                    handler,
                                                    false);
             }
+            else
+            {
+                MessagingService.instance().sendRR(message, target, handler, false);
+            }
         }
 
         handler.get();
@@ -870,10 +870,22 @@ public class StorageProxy implements StorageProxyMBean
         MessageOut<Mutation> message = mutation.createMessage(MessagingService.Verb.BATCHLOG_MUTATION);
         for (InetAddress target : endpoints)
         {
+            int targetVersion = MessagingService.instance().getVersion(target);
             if (canDoLocalRequest(target))
+            {
                 insertLocal(Stage.BATCHLOG_MUTATION, message.payload, handler);
+            }
+            else if (targetVersion < MessagingService.VERSION_30)
+            {
+                MessagingService.instance().sendRR(mutation.createMessage(MessagingService.Verb.MUTATION),
+                                                   target,
+                                                   handler,
+                                                   false);
+            }
             else
+            {
                 MessagingService.instance().sendRR(message, target, handler, false);
+            }
         }
     }
 


Mime
View raw message