yifan-c commented on a change in pull request #868:
URL: https://github.com/apache/cassandra/pull/868#discussion_r571258709
##########
File path: test/distributed/org/apache/cassandra/distributed/impl/Instance.java
##########
@@ -318,7 +320,11 @@ private static IMessage
serializeMessage(InetAddressAndPort from, InetAddressAnd
try (DataOutputBuffer out = new DataOutputBuffer(1024))
{
- Message.serializer.serialize(messageOut, out, toVersion);
+ IVersionedAsymmetricSerializer<?,?> payloadSerializer =
messageOut.header.verb.serializer();
+ if (null == payloadSerializer)
+ payloadSerializer =
MessagingService.instance().callbacks.responseSerializer(messageOut.header.id,
messageOut.header.from);
+
+ Message.serializer.serialize(messageOut, out, toVersion,
(IVersionedAsymmetricSerializer) payloadSerializer);
byte[] bytes = out.toByteArray();
if (messageOut.serializedSize(toVersion) != bytes.length)
Review comment:
```suggestion
int serializedSize = messageOut.serializedSize(toVersion,
(IVersionedAsymmetricSerializer) payloadSerializer);
if (serializedSize != bytes.length)
throw new AssertionError(String.format("Message
serializedSize(%s) does not match what was written with serialize(out, %s) for
verb %s and serializer %s; " +
"expected %s, actual
%s", toVersion, toVersion, messageOut.verb(), messageOut.serializer.getClass(),
serializedSize,
bytes.length));
```
Sorry that I forgot to update the usage of `serializedSize()`. We need to
pass in the `payloadSerializer`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]