cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject git commit: Read message id as string from older nodes.
Date Fri, 14 Mar 2014 17:53:30 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 c49d33633 -> c3aac4560


Read message id as string from older nodes.

Patch by marcuse, reviewed by jbellis for CASSANDRA-6840


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

Branch: refs/heads/cassandra-2.0
Commit: c3aac45605416251f7bb9a3260299f1c4416cb89
Parents: c49d336
Author: Marcus Eriksson <marcuse@apache.org>
Authored: Fri Mar 14 18:51:01 2014 +0100
Committer: Marcus Eriksson <marcuse@apache.org>
Committed: Fri Mar 14 18:52:59 2014 +0100

----------------------------------------------------------------------
 CHANGES.txt                                          |  1 +
 .../apache/cassandra/db/RowMutationVerbHandler.java  | 15 ++++++++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c3aac456/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index e208e21..2b8dea8 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -7,6 +7,7 @@
  * Restore expiring->deleted (cell) compaction optimization (CASSANDRA-6844)
  * Fix CompactionManager.needsCleanup (CASSANDRA-6845)
  * Correctly compare BooleanType values other than 0 and 1 (CASSANDRA-6779)
+ * Read message id as string from earlier versions (CASSANDRA-6840)
 Merged from 1.2:
  * fix nodetool getsstables for blob PK (CASSANDRA-6803)
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c3aac456/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java b/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java
index dcdfc2e..da7fa6a 100644
--- a/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java
+++ b/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java
@@ -46,7 +46,7 @@ public class RowMutationVerbHandler implements IVerbHandler<RowMutation>
                 replyTo = message.from;
                 byte[] forwardBytes = message.parameters.get(RowMutation.FORWARD_TO);
                 if (forwardBytes != null)
-                    forwardToLocalNodes(rm, message.verb, forwardBytes, message.from);
+                    forwardToLocalNodes(rm, message.verb, forwardBytes, message.from, message.version);
             }
             else
             {
@@ -68,7 +68,7 @@ public class RowMutationVerbHandler implements IVerbHandler<RowMutation>
      * Older version (< 1.0) will not send this message at all, hence we don't
      * need to check the version of the data.
      */
-    private void forwardToLocalNodes(RowMutation rm, MessagingService.Verb verb, byte[] forwardBytes,
InetAddress from) throws IOException
+    private void forwardToLocalNodes(RowMutation rm, MessagingService.Verb verb, byte[] forwardBytes,
InetAddress from, int version) throws IOException
     {
         DataInputStream in = new DataInputStream(new FastByteArrayInputStream(forwardBytes));
         int size = in.readInt();
@@ -79,7 +79,16 @@ public class RowMutationVerbHandler implements IVerbHandler<RowMutation>
         for (int i = 0; i < size; i++)
         {
             InetAddress address = CompactEndpointSerializationHelper.deserialize(in);
-            int id = in.readInt();
+            int id;
+            if (version < MessagingService.VERSION_20)
+            {
+                String s = in.readUTF();
+                id = Integer.parseInt(s);
+            }
+            else
+            {
+                id = in.readInt();
+            }
             Tracing.trace("Enqueuing forwarded write to {}", address);
             MessagingService.instance().sendOneWay(message, id, address);
         }


Mime
View raw message