[ 
https://issues.apache.org/jira/browse/CASSGO-98?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18039104#comment-18039104
 ] 

Bohdan Siryk commented on CASSGO-98:
------------------------------------

I think you're right, as the body of the envelope itself is not compressed, 
which the compression flag should indicate.

Native proto v5 spec says (1):
> 

> 2.4.1.2. flags

> Flags applying to this envelope. The flags have the following meaning 
> (described
> by the mask that allows selecting them):
>    0x01: Compression flag. In protocol v5 this flag is deprecated and ignored.


So Cassandra actually ignores this.

My understanding of fixing this bug is to add a check in newFramer func (2):

```
if compressor != nil && version < protoVersion5 {
    flags |= flagCompress
}
````

This should be sufficient to fix the issue, as it is the only place where we 
set the compression flag.

[~joaoreis] I can prepare a fix for this if you haven't started yet.
 
(1) 
https://github.com/apache/cassandra/blob/e621d8a6c1bb175bea4e7e25f1f39dcd3d648f76/doc/native_protocol_v5.spec#L285
(2) 
https://github.com/apache/cassandra-gocql-driver/blob/0326fae3617dd19b901f2e9a97479c04fc11e05a/frame.go#L396

> Frame compression header is being set with v5
> ---------------------------------------------
>
>                 Key: CASSGO-98
>                 URL: https://issues.apache.org/jira/browse/CASSGO-98
>             Project: Apache Cassandra Go driver
>          Issue Type: Bug
>          Components: Core
>            Reporter: João Reis
>            Priority: Normal
>             Fix For: 2.x
>
>
> In protocol v5 the frame (v5 envelope) compression header flag should be 
> ignored because compression happens at segment (v5 frame) level. The frame 
> body itself is not compressed so this is a bug.
> This was found when trying to connect to 
> [ZDM-Proxy|https://github.com/datastax/zdm-proxy/] but connecting to a C* 
> 5.0.x cluster works fine (I assume C* is ignoring this flag completely when 
> it's a v5 frame).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to