Golang driver sent back errors from ScyllaDB but cassandra 2.1.8 works

498 views
Skip to first unread message

Kishorekumar Neelamegam

<nkishore@megam.io>
unread,
Feb 15, 2016, 12:05:22 PM2/15/16
to ScyllaDB users
Hello,

Has anybody tried this driver ? https://github.com/gocql/gocql.

I tried the gocassa driver(https://github.com/megamsys/gocassa) built on top of  github.com/gocql/gocql with 

Cassandra 2.1.8

In cassandra a query is performed on 

SELECT data_center, rack, host_id, tokens, release_version FROM system.local WHERE key='local'

I received  the results

Enter code here...&gocql.Iter{err:error(nil), pos:0, meta:gocql.resultMetadata{flags:1, pagingState:[]uint8(nil), columns:[]gocql.ColumnInfo{gocql.ColumnInfo{Keyspace:"system", Table:"local", Name:"data_center", TypeInfo:gocql.NativeType{proto:0x3, typ:13, custom:""}}, gocql.ColumnInfo{Keyspace:"system", Table:"local", Name:"rack", TypeInfo:gocql.NativeType{proto:0x3, typ:13, custom:""}}, gocql.ColumnInfo{Keyspace:"system", Table:"local", Name:"host_id", TypeInfo:gocql.NativeType{proto:0x3, typ:12, custom:""}}, gocql.ColumnInfo{Keyspace:"system", Table:"local", Name:"tokens", TypeInfo:gocql.CollectionType{NativeType:gocql.NativeType{proto:0x3, typ:34, custom:""}, Key:gocql.TypeInfo(nil), Elem:gocql.NativeType{proto:0x3, typ:13, custom:""}}}, gocql.ColumnInfo{Keyspace:"system", Table:"local", Name:"release_version", TypeInfo:gocql.NativeType{proto:0x3, typ:13, custom:""}}}, colCount:5, actualColCount:5}, numRows:1, next:(*gocql.nextIter)(nil), host:(*gocql.HostInfo)(nil), framer:(*gocql.framer)(0xc8200d80b0), once:sync.Once{m:sync.Mutex{state:0, sema:0x0}, done:0x0}}


and it works

Scylla -  Docker image latest Scylla version 0.17-20160208.b2eb081

The same query returns back with no info.

&gocql.Iter{err:error(nil), pos:0, meta:gocql.resultMetadata{flags:4, pagingState:[]uint8(nil), columns:[]gocql.ColumnInfo(nil), colCount:0, actualColCount:0}, numRows:1, next:(*gocql.nextIter)(nil), host:(*gocql.HostInfo)(nil), framer:(*gocql.framer)(0xc820094370), once:sync.Once{m:sync.Mutex{state:0, sema:0x0}, done:0x0}}


Here is the error i get.

unable to fetch host info for 127.0.0.1: gocql: not enough columns to scan into: have 5 want 0

When i run manually the query from "cqlsh", i received the results.

Why am i receiving this error  ?  Why does scylla not sent back the results, where as cassandra 2.1.8 does ? 


Dor Laor

<dor@scylladb.com>
unread,
Feb 15, 2016, 4:48:23 PM2/15/16
to ScyllaDB users
On Mon, Feb 15, 2016 at 7:05 PM, Kishorekumar Neelamegam <nkis...@megam.io> wrote:
Hello,

Has anybody tried this driver ? https://github.com/gocql/gocql.

Hmmm, we had a bug that was closed regarding gocql:

Maybe there is another issue. You're welcomed to open a fresh issue, I believe it's a Scylla issue
 

--
You received this message because you are subscribed to the Google Groups "ScyllaDB users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scylladb-user...@googlegroups.com.
To post to this group, send email to scyllad...@googlegroups.com.
Visit this group at https://groups.google.com/group/scylladb-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/scylladb-users/9dbe5f73-2472-41f3-a3d7-e37d2e4b9dec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Shlomi Livne

<shlomi@scylladb.com>
unread,
Feb 15, 2016, 5:18:18 PM2/15/16
to ScyllaDB users
can you please provide the logs of the docker container

I suspect that the CQL client is binding to another ip then 127.0.0.1

On my machine I have the following

shlomi@localhost~/urchin-ccm (master)$ sudo docker logs desperate_carson
EAL: Detected lcore 0 as core 0 on socket 0
EAL: Detected lcore 1 as core 1 on socket 0
EAL: Detected lcore 2 as core 0 on socket 0
EAL: Detected lcore 3 as core 1 on socket 0
EAL: Support maximum 128 logical core(s) by configuration.
EAL: Detected 4 lcore(s)
EAL: VFIO modules not all loaded, skip VFIO support...
EAL: Setting up physically contiguous memory...
EAL: TSC frequency is ~2693768 KHz
EAL: Master lcore 0 is ready (tid=a9fe45c0;cpuset=[0])
EAL: lcore 3 is ready (tid=9c816700;cpuset=[3])
EAL: lcore 2 is ready (tid=9d017700;cpuset=[2])
EAL: lcore 1 is ready (tid=9d818700;cpuset=[1])
Scylla version 0.17-20160208.b2eb081 starting ...
Scylla API server listening on 127.0.0.1:10000 ...
Starting listening for CQL clients on 172.17.0.3:9042...

Try connecting to that ip using cqlsh and running the query

 ~/cassandra/bin/cqlsh 172.17.0.3 -e "SELECT data_center, rack, host_id, tokens, release_version FROM system.local WHERE key='local'"

In my case it did return values and works.

using the 127.0.0.1 ip does not work.





Shlomi Livne

<shlomi@scylladb.com>
unread,
Feb 15, 2016, 5:28:15 PM2/15/16
to Shlomi Livne, ScyllaDB users
Starting scylla docker using the http://www.scylladb.com/doc/getting-started/ instructions (e.g. docker run -p $(hostname -i):9042:9042 -i -t scylladb/scylla)

does make

~/cassandra/bin/cqlsh 127.0.0.1 -e "SELECT data_center, rack, host_id, tokens, release_version FROM system.local WHERE key='local'"

work for me

Can you please also provide the info on how you start the scylla docker image

Kishorekumar Neelamegam

<nkishore@megam.io>
unread,
Feb 16, 2016, 12:48:18 AM2/16/16
to ScyllaDB users, shlomi@scylladb.com
The issue isn't with docker.

Here is my docker log/docker command
sudo docker run -p 9042:9042 -i -t scylladb/scylla
EAL: Detected lcore 0 as core 0 on socket 0
EAL: Detected lcore 1 as core 0 on socket 0
EAL: Detected lcore 2 as core 1 on socket 0
EAL: Detected lcore 3 as core 1 on socket 0
EAL: Support maximum 128 logical core(s) by configuration.
EAL: Detected 4 lcore(s)
EAL: VFIO modules not all loaded, skip VFIO support...
EAL: Setting up physically contiguous memory...
EAL: TSC frequency is ~2491912 KHz
EAL: Master lcore 0 is ready (tid=ec46a5c0;cpuset=[0])
EAL: lcore 1 is ready (tid=dfc9e700;cpuset=[1])
EAL: lcore 3 is ready (tid=dec9c700;cpuset=[3])
EAL: lcore 2 is ready (tid=df49d700;cpuset=[2])
Scylla version 0.17-20160208.b2eb081 starting ...
Scylla API server listening on 127.0.0.1:10000 ...
Starting listening for CQL clients on 172.17.0.2:9042..

cqlsh works ok. 

~/software/cassandra/bin/cqlsh 127.0.0.1 -e "SELECT data_center, rack, host_id, tokens, release_version FROM system.local WHERE key='local'

> "

 data_center | rack  | host_id                              | tokens  

But the golang driver doesn't return the info as noted above ? Do you believe this is an issue ? 

On Tuesday, February 16, 2016 at 3:58:15 AM UTC+5:30, Shlomi Livne wrote:
Starting scylla docker using the http://www.scylladb.com/doc/getting-started/ instructions (e.g. docker run -p $(hostname -i):9042:9042 -i -t scylladb/scylla)

does make

~/cassandra/bin/cqlsh 127.0.0.1 -e "SELECT data_center, rack, host_id, tokens, release_version FROM system.local WHERE key='local'"

work for me

Can you please also provide the info on how you start the scylla docker image

sudo docker run -p 9042:9042 -i -t scylladb/scylla
EAL: Detected lcore 0 as core 0 on socket 0
EAL: Detected lcore 1 as core 0 on socket 0
EAL: Detected lcore 2 as core 1 on socket 0
EAL: Detected lcore 3 as core 1 on socket 0
EAL: Support maximum 128 logical core(s) by configuration.
EAL: Detected 4 lcore(s)
EAL: VFIO modules not all loaded, skip VFIO support...
EAL: Setting up physically contiguous memory...
EAL: TSC frequency is ~2491912 KHz
EAL: Master lcore 0 is ready (tid=ec46a5c0;cpuset=[0])
EAL: lcore 1 is ready (tid=dfc9e700;cpuset=[1])
EAL: lcore 3 is ready (tid=dec9c700;cpuset=[3])
EAL: lcore 2 is ready (tid=df49d700;cpuset=[2])
Scylla version 0.17-20160208.b2eb081 starting ...
Scylla API server listening on 127.0.0.1:10000 ...
Starting listening for CQL clients on 172.17.0.2:9042..

 

Kishorekumar Neelamegam

<nkishore@megam.io>
unread,
Feb 16, 2016, 12:59:47 AM2/16/16
to ScyllaDB users
Here is my test code, it still fails.


Let me know i can create an issue.

Kishorekumar Neelamegam

<nkishore@megam.io>
unread,
Feb 16, 2016, 8:27:19 AM2/16/16
to ScyllaDB users
Shlomi  Livne,

Is there an update on this  problem ? 

Kishorekumar Neelamegam

<nkishore@megam.io>
unread,
Feb 16, 2016, 9:03:21 AM2/16/16
to ScyllaDB users
Shlomi Livne,

Created an issue https://github.com/scylladb/scylla/issues/912

Would be great, if you can respond to this ?

Glauber Costa

<glauber@scylladb.com>
unread,
Feb 16, 2016, 9:49:29 AM2/16/16
to scylladb-users@googlegroups.com
On Tue, Feb 16, 2016 at 9:03 AM, Kishorekumar Neelamegam
<nkis...@megam.io> wrote:
> Shlomi Livne,
>
> Created an issue https://github.com/scylladb/scylla/issues/912
>
> Would be great, if you can respond to this ?

Hi

Let me see if I can reproduce this locally.
> --
> You received this message because you are subscribed to the Google Groups
> "ScyllaDB users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to scylladb-user...@googlegroups.com.
> To post to this group, send email to scyllad...@googlegroups.com.
> Visit this group at https://groups.google.com/group/scylladb-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/scylladb-users/87e5d376-108c-4b31-ad28-0e8f6423540a%40googlegroups.com.

Shlomi Livne

<shlomi@scylladb.com>
unread,
Feb 16, 2016, 10:06:07 AM2/16/16
to ScyllaDB users

Kishorekumar Neelamegam

<nkishore@megam.io>
unread,
Feb 18, 2016, 11:01:25 AM2/18/16
to ScyllaDB users
Thanks Glauber.

Our teammate Yeshwanth(https://github.com/morpheyesh - get...@megam.io) debugged this problem and fixed it.

It turns out there is a bug in https://github.com/hailocab/gocassa driver. 

Whereas the base https://github.com/gocql/gocql works just fine.


On Monday, February 15, 2016 at 10:35:22 PM UTC+5:30, Kishorekumar Neelamegam wrote:

angelos.kapsimanis@gmail.com

<angelos.kapsimanis@gmail.com>
unread,
Feb 22, 2016, 3:44:03 PM2/22/16
to ScyllaDB users
Hi Kishorekumar,

where can we get the fix? I can't find anything in gocql's repo.

Thank you in advance for your answer.

Tzach Livyatan

<tzach@scylladb.com>
unread,
Feb 24, 2016, 2:47:29 AM2/24/16
to ScyllaDB users
Hi Angelos
Can you please help us reproduce the issue?
It will be useful is you can share an example program which fail

Thanks
Tzach 


--
You received this message because you are subscribed to the Google Groups "ScyllaDB users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scylladb-user...@googlegroups.com.
To post to this group, send email to scyllad...@googlegroups.com.
Visit this group at https://groups.google.com/group/scylladb-users.

Kishorekumar Neelamegam

<nkishore@megam.io>
unread,
Feb 24, 2016, 4:47:51 AM2/24/16
to ScyllaDB users, angelos.kapsimanis@gmail.com
Angelos,

We are not going to push this fix to upstream, as the problem doesn't exist in cassandra.  

You are welcome to do so to get it merged though.

Its under testing https://github.com/megamsys/gocql here. I will be confident of this fix after more rigorous testing done by next week mid.

@morpheyesh ?  Can you add your thoughts here on the problem and  fix you did ? 

Tzach Livyatan

<tzach@scylladb.com>
unread,
Feb 24, 2016, 4:57:53 AM2/24/16
to ScyllaDB users, Angelos Kapsimanis
Hi Kishorekumar, morpheyesh
Thanks for letting us know
The only significant change I see in the PR[1] is:
- hosts, _, err = s.hostSource.GetHosts()
+ hosts = s.hostSource.session.ring.allHosts()
Is it the case?
Any idea why the original version worked with C* and not in Scylla?





--
You received this message because you are subscribed to the Google Groups "ScyllaDB users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scylladb-user...@googlegroups.com.
To post to this group, send email to scyllad...@googlegroups.com.
Visit this group at https://groups.google.com/group/scylladb-users.

Kishorekumar Neelamegam

<nkishore@megam.io>
unread,
Feb 24, 2016, 5:08:52 AM2/24/16
to ScyllaDB users, angelos.kapsimanis@gmail.com


On Wednesday, February 24, 2016 at 3:27:53 PM UTC+5:30, Tzach Livyatan wrote:
Hi Kishorekumar, morpheyesh
Thanks for letting us know
The only significant change I see in the PR[1] is:
- hosts, _, err = s.hostSource.GetHosts()
+ hosts = s.hostSource.session.ring.allHosts()
Is it the case?
Yesh can answer that. 
Any idea why the original version worked with C* and not in Scylla?
No idea, as we were focused on getting scylla to work. 

Pekka Enberg

<penberg@scylladb.com>
unread,
Feb 24, 2016, 7:49:38 AM2/24/16
to ScyllaDB users, Angelos Kapsimanis
On Wed, Feb 24, 2016 at 11:57 AM, Tzach Livyatan <tz...@scylladb.com> wrote:
> Any idea why the original version worked with C* and not in Scylla?

Scylla implemented the PREPARED message differently from Cassandra.
The gocql driver makes an (incorrect) assumption that the result
metadata section is always present. Scylla didn't provide one which
exposed a bug in the gocql driver.

I fixed it on Scylla side, though, to just follow Cassandra's lead here:

https://github.com/scylladb/scylla/issues/912

- Pekka

Kishorekumar Neelamegam

<nkishore@megam.io>
unread,
Feb 24, 2016, 8:27:18 AM2/24/16
to ScyllaDB users, angelos.kapsimanis@gmail.com
Thanks Pekka. Hopefully this will appear in Scylla 0.19 release ?  

Pekka Enberg

<penberg@scylladb.com>
unread,
Feb 24, 2016, 8:37:42 AM2/24/16
to ScyllaDB users, Kishorekumar Neelamegam, Angelos Kapsimanis
On Wed, Feb 24, 2016 at 3:27 PM, Kishorekumar Neelamegam
<nkis...@megam.io> wrote:
> Thanks Pekka. Hopefully this will appear in Scylla 0.19 release ?

Yup, it will be part of 0.19.

- Pekka
Reply all
Reply to author
Forward
0 new messages