Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Jan 31 2019 18:55
    Zariel commented #1205
  • Jan 31 2019 18:55
    jmhon08 commented #1205
  • Jan 31 2019 18:53
    jmhon08 commented #1205
  • Jan 31 2019 16:12
    mmatczuk closed #1260
  • Jan 31 2019 13:24
    mmatczuk synchronize #1211
  • Jan 31 2019 13:21
    mmatczuk edited #1260
  • Jan 31 2019 13:19
    mmatczuk opened #1260
  • Jan 31 2019 13:06
    lukasmrtvy commented #1205
  • Jan 31 2019 13:03
    lukasmrtvy commented #1205
  • Jan 30 2019 20:47
    jmhon08 commented #1205
  • Jan 30 2019 17:08
    beltran commented #1259
  • Jan 30 2019 13:10
    NWilson opened #1259
  • Jan 29 2019 23:47
    MichaelS11 commented #1139
  • Jan 29 2019 22:53
    adranwit commented #1246
  • Jan 26 2019 23:44
    zachaller commented #1139
  • Jan 26 2019 15:55
    Zariel commented #1253
  • Jan 26 2019 12:35

    Zariel on master

    conn: send heartbeats to detect… (compare)

  • Jan 26 2019 12:35
    Zariel closed #1258
  • Jan 26 2019 12:35
    Zariel closed #1139
  • Jan 26 2019 12:17
    Zariel opened #1258
I find that initially gocql connects on the address I provide, then cassandra in a container broadcasts back its internal docker network IP and gocql tries three attempts, 3 seconds apart on that address, until it finally just uses the connection it had before...
sorry 1 minute apart*
so 3 minutes in total on average to obtain a session.
Oh that issue is longer XD Ill keep reading
Chris Bannister
@GeorgeMac yeah im not sure what do about that, I think in most prod cases this is not likely to happen
but for dev its not ideal
Vincent Rischmann
Hi. Just wondering what sort of retry policy are people using with gocql today ?
Chris Bannister
@vrischmann im still using the standard one, but I keep meaning to improve retries, its on my list of things that are not good enough in gocql
Nimi Wariboko Jr.
Does the gocql driver support UNSET (https://issues.apache.org/jira/browse/CASSANDRA-7304)?
Xe Iaso
Why does https://godoc.org/github.com/gocql/gocql#SslOptions reference a concrete tls.Config and not a pointer to one? Passing it like this will copy the mutex in the tls.Config's sync.Once by value.
Chris Bannister
@Xe looks like a bug
Ashton Kinslow
Hello - I was wondering if anyone has an example of any kind of sharing sessions across a large application ?
Edward McFarlane
Hello, what is the best way to handle authentication for multiple clients? Create multiple authenticated sessions?
Blake Atkinson
How do you mean: "multiple clients"? Each instance of your service that communicates with C* should have a single, long-lived session
Chris Bannister
@afking can you elaborate on what you mean?
I dont think you can define different cluster authentication per client?
Blake Atkinson
Hi @Zariel , can you elaborate a little bit about your comment on DCAwareRR LB policy?
mostly about "calculating a query plan for every query". do you mean building that concatenated local+remote host list?
Chris Bannister
The plan creation should be O(1)
but by building the list of all the hosts in the order we will return them is O(N)
Blake Atkinson
thanks for the response, Chris. and we have to build that list of all hosts at Pick() execution time since it can change concurrently? sorry if the questions are basic, I'm just curious how we could address that TODO, if at all.
Chris Bannister
we dont have to, its just simpler too.
Possibly a bit too simple, something using the hostlist COW would be doable, a list for local and remote hosts
Blake Atkinson
I imagine it could have some kind of impact for clients using significantly large clusters. COW == "copy-on-write"?
Happy to see this added to the project, btw.
Ralph Caraveo III
Hello friends, I posted a more detailed question to the Google Group for this package but I thought I'd check here. We have a use case where we'd like to implement some circuit-breaking type code when we're doing some gocql writes to C* where we have a situation that some overburdened nodes become too hot and error out. In this case we'd like to implement fallback functionality on the circuit. We're using the TokenAwarePolicy and we'd like to be able to take some stats against the nodes that are erroring out to some threshold. The question is: Does the gocql API have an existing way to get the node that errored out related to the token/partition key? This way --- if our circuit is open for a particular routing key, then we can just do our fallback behavior to not continually overburden the hot nodes until they come back online.
This is a bit of a long winded question but thanks for any heads up on the help here.

Hello, I want to insert/alter tables using go cql. I have a script which will generate all the required cql statements and dumps into a .cql file.

Can I read cql statements from a file using gocql ? I see we have a similar thing using cqlsh client
cqlsh -f <path-to-cql file>


Hi, I am new to golang and gocql. I have question and can't find way to resolve the connection issue.

Currently I am using cassandra 2.1.5.
cluster := gocql.NewCluster(".....")
cluster.Keyspace = "production"
session, _ := cluster.CreateSession()

then I got error message like ;

panic: no valid connect address for host: [HostInfo connectAddress="<nil>" peer="<nil>" rpc_address="<nil>" broadcast_address="<nil>" preferred_ip="<nil>" connect_addr="" connect_addr_source="invalid" port=9042 data_centre="datacenter1" rack="rack1" host_id="*" version="v2.1.5" state=UP num_tokens=1]. Is your cluster configured correctly?

When I test this code with cassandra 3.1 , it works but 2.1.5 it doesn't

system.local's schema is different between two versions and I think it cause the problem.

Is there any way to resolve this ?

Mehryar Maalem
Hey all, I'm trying to perform an insert operation using gocql to a cassandra table that contains a list of UDTs and I cannot figure out where I am messing up. I wrote a question here: https://stackoverflow.com/questions/52844147/inserting-an-array-of-user-defined-types-into-cassandra-using-gocql Any help would be very appreciated :)
Rishabh Gupta
I am trying to run go test -run UnmarshalDate but it is showing no test is present, sorry for the noobie question.
Rishabh Gupta
Thanks guys, my bad
there is a concept of tags in test files, now I am able to run it.
sateesh kumar

Can we use both tokenaware and dcaware Roundrobin policy using GOLANG cassandra driver ?


if yes, how can we use ?

cassandra version 3.11.4
Pinank Lakhani

I am getting following error while trying to create session from cql,
"Consistency level ANY is not supported for this operation. Supported consistency levels are: ONE, LOCAL_QUORUM, LOCAL_ONE"

I am using "Amazon Managed Apache Cassandra Service".

I have set following properties,

clusterConfig := gocql.NewCluster("<HOST>")
clusterConfig.Authenticator = gocql.PasswordAuthenticator{Username: "Username", Password: "Password"}
clusterConfig.SslOpts = &gocql.SslOptions{
CaPath: "./AmazonRootCA1.pem",
clusterConfig.Consistency = gocql.LocalQuorum
clusterConfig.ConnectTimeout = time.Second * 10
clusterConfig.ProtoVersion = 3
clusterConfig.DisableInitialHostLookup = true
clusterConfig.Keyspace = "TestDB"
clusterConfig.NumConns = 3
session, err := clusterConfig.CreateSession()
if err != nil {
fmt.Println("err>", err)
return session

Pinank Lakhani
Please help me out
Scott Mattan
I cannot find anything on the error missing K_EXISTS at '<missiing ' anyone have an idea what K_EXISTS is?
Reginald McDonald

Hello! I was looking at the BatchObserver for gocql and came across this in the comments:

It says that this is called for every query in the batch. I just wanted to clarify whether it is the BatchObserver thats called for each query, or the QueryObserver?

Иван Сердюк
Anyone interested to help with compilation bugs, when I would track down/report those, with https://go.googlesource.com/gollvm/ ?
Ahmad Hosseini
Hi every body . i got an error: gocql can not marshal float64 into float - yet in last version
Sigit Kurniawan

hello there, I just have a problem when creating session..

gocql: received unexpected frame on stream 0: [header version=[version=3 direction=RESP] flags=0x0 stream=0 op=SUPPORTED length=96]

could you help me?
Not sure if this is the right place to ask for PR review, can someone take a look at this oneliner: gocql/gocql#1573
Kunal Taitkar
gocql/gocql#1449 - anyone facing this issue?
any fix for this
Hey team, gocql/gocql#1449 facing gocql connection issue
Kunal Taitkar
hi can anyone please help, how we can run/build in gocql debug mode?
Ashton Kinslow
Hey guys, anyone have any examples with a where somefield IN ? where the parameter is a []string{}? I cant figure out if it should be somefield in (?) or if I should be serializing the []string{} my self to be ('x','y') ect..