cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tylerho...@apache.org
Subject [2/4] cassandra git commit: Always use RANGE_SLICE verb for 3.x messages
Date Wed, 10 Aug 2016 16:13:33 GMT
Always use RANGE_SLICE verb for 3.x messages

Patch by Tyler Hobbs; reviewed by Benjamin Lerer for CASSANDRA-12249


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

Branch: refs/heads/cassandra-3.9
Commit: b188e0826e6b9a14d137b9497bb63dec875f6c83
Parents: 18c357b
Author: Tyler Hobbs <tylerlhobbs@gmail.com>
Authored: Wed Aug 10 11:09:38 2016 -0500
Committer: Tyler Hobbs <tylerlhobbs@gmail.com>
Committed: Wed Aug 10 11:11:30 2016 -0500

----------------------------------------------------------------------
 CHANGES.txt                                             |  2 ++
 src/java/org/apache/cassandra/net/MessageOut.java       |  2 +-
 src/java/org/apache/cassandra/net/MessagingService.java | 10 ++++++++++
 3 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b188e082/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 388a290..10c5d40 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -28,6 +28,8 @@
  * Add repaired percentage metric (CASSANDRA-11503)
  * Add Change-Data-Capture (CASSANDRA-8844)
 Merged from 3.0:
+ * Fix potential bad messaging service message for paged range reads
+   within mixed-version 3.x clusters (CASSANDRA-12249)
  * Fix paging logic for deleted partitions with static columns (CASSANDRA-12107)
  * Wait until the message is being send to decide which serializer must be used (CASSANDRA-11393)
  * Fix migration of static thrift column names with non-text comparators (CASSANDRA-12147)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b188e082/src/java/org/apache/cassandra/net/MessageOut.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/net/MessageOut.java b/src/java/org/apache/cassandra/net/MessageOut.java
index bc5c41b..34694a6 100644
--- a/src/java/org/apache/cassandra/net/MessageOut.java
+++ b/src/java/org/apache/cassandra/net/MessageOut.java
@@ -104,7 +104,7 @@ public class MessageOut<T>
     {
         CompactEndpointSerializationHelper.serialize(from, out);
 
-        out.writeInt(verb.ordinal());
+        out.writeInt(MessagingService.Verb.convertForMessagingServiceVersion(verb, version).ordinal());
         out.writeInt(parameters.size());
         for (Map.Entry<String, byte[]> entry : parameters.entrySet())
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b188e082/src/java/org/apache/cassandra/net/MessagingService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/net/MessagingService.java b/src/java/org/apache/cassandra/net/MessagingService.java
index 220fc66..3302357 100644
--- a/src/java/org/apache/cassandra/net/MessagingService.java
+++ b/src/java/org/apache/cassandra/net/MessagingService.java
@@ -151,6 +151,16 @@ public final class MessagingService implements MessagingServiceMBean
         UNUSED_4,
         UNUSED_5,
         ;
+
+        // This is to support a "late" choice of the verb based on the messaging service
version.
+        // See CASSANDRA-12249 for more details.
+        public static Verb convertForMessagingServiceVersion(Verb verb, int version)
+        {
+            if (verb == PAGED_RANGE && version >= VERSION_30)
+                return RANGE_SLICE;
+
+            return verb;
+        }
     }
 
     public static final EnumMap<MessagingService.Verb, Stage> verbStages = new EnumMap<MessagingService.Verb,
Stage>(MessagingService.Verb.class)


Mime
View raw message