You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "C. Scott Andreas (JIRA)" <ji...@apache.org> on 2018/11/18 18:23:01 UTC

[jira] [Updated] (CASSANDRA-8100) Remove payload size from intra-cluster messages

     [ https://issues.apache.org/jira/browse/CASSANDRA-8100?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

C. Scott Andreas updated CASSANDRA-8100:
----------------------------------------
    Component/s: Streaming and Messaging

> Remove payload size from intra-cluster messages
> -----------------------------------------------
>
>                 Key: CASSANDRA-8100
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8100
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Streaming and Messaging
>            Reporter: Sylvain Lebresne
>            Priority: Major
>             Fix For: 4.x
>
>
> Intra-cluster messages ship with the [size of their payload|https://github.com/apache/cassandra/blob/8d8fed52242c34b477d0384ba1d1ce3978efbbe8/src/java/org/apache/cassandra/net/MessageOut.java#L118] before said payload. We mostly don't need it however as deserializers don't rely on it to know when to stop. The [only reason we need it|https://github.com/apache/cassandra/blob/8d8fed52242c34b477d0384ba1d1ce3978efbbe8/src/java/org/apache/cassandra/net/MessageIn.java#L86] is that all responses message use the same {{Verb}} and so in those case we use the message callback to find out the proper serializer, but in the (unlikely) case where the callback has expired, we don't know which deserializer to use and so we use the payload size to skip the payload.
> Having to ship the payload size means we need to be able to compute it. Which means we have to implement the serializedSize for all of your serializer (not a huge deal but annoying), but more importantly, this makes it impossible to write a request response truly incrementally (CASSANDRA-8099) since you have to buffer everything in memory just to compute the serialized size.
> So I propose we remove the payload size from messages. Instead, we can assign specific {{Verb}} to each response type (getting rid of {{CallbackDeterminedSerializer}}). We can then get rid of all the serializedSize methods (for upgrade, when we need to generate messages to old nodes, we could just write the message in a ByteBuffer, write the resulting size and then write the buffer).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org