Details
-
Bug
-
Status: Resolved
-
Low
-
Resolution: Won't Fix
-
None
-
Mixed 1.2.18 + 2.0.17 environment, used temporarily during incremental migration process.
-
Low
Description
During mixed versions tests I've discovered that mixed 1.2.18 + 2.0.17 environment gives the following exception on 2.0.17 node:
java.lang.ClassCastException: org.apache.cassandra.db.SliceByNamesReadCommand cannot be cast to org.apache.cassandra.db.SliceFromReadCommand
at org.apache.cassandra.db.SliceFromReadCommandSerializer.serializedSize(SliceFromReadCommand.java:242)
at org.apache.cassandra.db.ReadCommandSerializer.serializedSize(ReadCommand.java:204)
at org.apache.cassandra.db.ReadCommandSerializer.serializedSize(ReadCommand.java:134)
at org.apache.cassandra.net.MessageOut.serialize(MessageOut.java:116)
at org.apache.cassandra.net.OutboundTcpConnection.writeInternal(OutboundTcpConnection.java:251)
at org.apache.cassandra.net.OutboundTcpConnection.writeConnected(OutboundTcpConnection.java:203)
at org.apache.cassandra.net.OutboundTcpConnection.run(OutboundTcpConnection.java:151)
The exception is caused by inconsistent commandType handling in ReadCommandSerializer(),
out.writeByte(newCommand.commandType.serializedValue); switch (command.commandType) /// <----------- WHY NOT newCommand.commandType -- DCI ??? { case GET_BY_NAMES: SliceByNamesReadCommand.serializer.serialize(newCommand, superColumn, out, version); break; case GET_SLICES: SliceFromReadCommand.serializer.serialize(newCommand, superColumn, out, version); break; default: throw new AssertionError(); }
Proposed fix (also attached as a patch):
diff --git a/src/java/org/apache/cassandra/db/ReadCommand.java b/src/java/org/apache/cassandra/db/ReadCommand.java index cadcd7d..f2153e8 100644 --- a/src/java/org/apache/cassandra/db/ReadCommand.java +++ b/src/java/org/apache/cassandra/db/ReadCommand.java @@ -153,7 +153,7 @@ class ReadCommandSerializer implements IVersionedSerializer<ReadCommand> } out.writeByte(newCommand.commandType.serializedValue); - switch (command.commandType) + switch (newCommand.commandType) { case GET_BY_NAMES: SliceByNamesReadCommand.serializer.serialize(newCommand, superColumn, out, version); @@ -196,7 +196,7 @@ class ReadCommandSerializer implements IVersionedSerializer<ReadCommand> } } - switch (command.commandType) + switch (newCommand.commandType) { case GET_BY_NAMES: return 1 + SliceByNamesReadCommand.serializer.serializedSize(newCommand, superColumn, version);
Attachments
Attachments
Issue Links
- is related to
-
CASSANDRA-14414 Errors in Supercolumn support in 2.0 upgrade
-
- Resolved
-