absurdfarce commented on issue #1911:
URL: 
https://github.com/apache/cassandra-gocql-driver/issues/1911#issuecomment-3332206513

   I've been looking at this for some time @joao-r-reis and to be honest I'm 
_still_ not sure if it's exactly the same bug.
   
   The really weird thing about this is that when I run my code against DSE 
6.9.0 I receive _no protocol error_ back from the server.  Note the error 
output here:
   
   ```
   $ ./version 
   2025/09/25 00:16:44 DBG gocql: Discovered protocol version using host. 
protocol_version=5 host_addr=127.0.0.1 host_id=
   2025/09/25 00:16:44 INF gocql: Discovered protocol version. 
protocol_version=5
   2025/09/25 00:16:44 WRN gocql: Control connection error. host_addr=127.0.0.1 
host_id= err=gocql: crc24 mismatch in frame header, computed: 7052973, got: 0
   2025/09/25 00:16:44 DBG gocql: Reconnecting the control connection. 
   2025/09/25 00:16:44 ERR gocql: Unable to connect to any ring node, control 
connection falling back to initial contact points. err=
   2025/09/25 00:16:44 INF gocql: Control connection setup failed after 
connecting to host. host_addr=127.0.0.1 port=9042 host_id= err=could not 
retrieve control host info: gocql: crc24 mismatch in frame header, computed: 
7052973, got: 0
   gocql: unable to create session: unable to connect to initial hosts: could 
not retrieve control host info: gocql: crc24 mismatch in frame header, 
computed: 7052973, got: 0
   ```
   
   When I try _the exact same client code_ using your branch I see that v4 is 
set _after parsing the protocol error_... which is entirely consistent with 
what I would expect based on your changes:
   
   ```
   $ ./version 
   2025/09/25 00:18:09 DBG gocql: Request failed because context elapsed out on 
connection. host_id= addr=127.0.0.1 ctx_err=context canceled
   2025/09/25 00:18:09 DBG gocql: Discovered protocol version using host after 
parsing protocol error. protocol_version=4 host_addr=127.0.0.1 host_id=
   2025/09/25 00:18:09 INF gocql: Discovered protocol version. 
protocol_version=4
   2025/09/25 00:18:09 DBG gocql: Added control host (session initialization). 
host_addr=127.0.0.1 host_id=402d725e-7e6c-4f79-b6ec-ba29ff55f33f
   2025/09/25 00:18:09 INF gocql: Control connection connected to host. 
host_addr=127.0.0.1 host_id=402d725e-7e6c-4f79-b6ec-ba29ff55f33f
   2025/09/25 00:18:09 INF gocql: Refreshed ring. 
ring=[127.0.0.1-402d725e-7e6c-4f79-b6ec-ba29ff55f33f:UP]
   2025/09/25 00:18:09 INF gocql: Session initialized successfully. 
   2025/09/25 00:18:09 DBG gocql: Pool connected to node. host_addr=127.0.0.1 
port=9042 host_id=402d725e-7e6c-4f79-b6ec-ba29ff55f33f
   2025/09/25 00:18:09 DBG gocql: Logging number of connections of pool after 
filling stopped. host_addr=127.0.0.1 
host_id=402d725e-7e6c-4f79-b6ec-ba29ff55f33f count=2
   Version is:  6.9.0
   ```
   
   For sake of completeness here the client for both trials above is:
   
   ```go
   package main
   
   import (
        "fmt"
   
        gocql "github.com/apache/cassandra-gocql-driver/v2"
   )
   
   func main() {
   
        cluster := gocql.NewCluster("127.0.0.1")
        cluster.Logger = gocql.NewLogger(gocql.LogLevelDebug)
        session, err := cluster.CreateSession()
        if err != nil {
                fmt.Println(err)
        }
   
        var dse_version string
        query := session.Query(`select dse_version from 
system.local`).Consistency(gocql.One)
        if err = query.Scan(&dse_version); err != nil {
                fmt.Println(err)
        }
   
        fmt.Println("Version is: ", dse_version)
   }
   ```
   
   The part I cannot understand is why your code gets to the protocol error 
handling at all.  Your code is pretty clearly getting a non-nil err value in 
[this 
block](https://github.com/joao-r-reis/cassandra-gocql-driver/blob/cassgo-88/control.go#L263C1-L286C1)
 while my code is not... while my code is getting a nil err value in [the 
equivalent 
block](https://github.com/apache/cassandra-gocql-driver/blob/v2.0.0-rc1/control.go#L240-L263)
 in v2.0.0-rc1.
   
   I feel like I'm very much still missing something.


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to