Error returned that means unknown

2019-04-26 Thread Long Quanzheng
Hi

We found that Cassandra can return timeout error but the actual operation
succeeded.
https://github.com/gocql/gocql/blob/master/conn.go#L1441

Is there a way to know all those kind of errors?

Here is the background why we need this:
We are using two phase commit:
1) append data to tableA
2) execute LWT on tableB
3) So if 2) fails we need to clean up the data written into tableA.
Otherwise we lost data.

Previously we always clean up  in 3) if we got any error from 2), which is
wrong for ErrorTimeoutNoReponse. This error simply means the result is
unknown. So we should whitelist this error. But we don't know what are the
other errors that should also be whitelisted.

*Alternative:*
What we can also do is instead of whitelisting, we do backlisting. We only
clean up in 3) for certain error that we know that 2) doesn't succeed. But
from the gocql code, I don't know how to find all of them. If we don't
clean up correctly in those case, we may leak some data that will never be
deleted.

Thanks


Failure reason for batch conditional update

2018-09-07 Thread Long Quanzheng
Hi
I did a logged batch of conditional update, and sometimes(not always) got
failure, and return of conflicting columns show that there is no
conflicting value. Is there any other reason that batch can fail?

My batch is like:
```
update tblA set col1=1 where pk=1 and col1=1; //to make sure no other
update on this row
update tblA set col2=2,col3=3 where pk=2 and col2=1;
update tblA set col4=4,col5=5 where pk=2 and col2=1;//because there are too
many columns on this row to update, we use multiple queries to make it
looks better
update tblA set col7=7,col6=6 where pk=3 and col7=7;// also make sure no
other update on this row
``

And sometimes it would return applied=false, with returning that
the row of pk=1 matches the condition
the row of pk=2 matches the condition, but applied=false
the row of pk=3 matches the condition, but applied=false

Is there any explanation?

I am using latest gocql, cassandra is Cassandra 3.0.14.10
-- 

Thanks,
Quanzheng


Re: Error of "You have to be logged in and not anonymous to perform this request"

2017-03-19 Thread Long Quanzheng
Thanks.
Good to know that. But that's a little confusing for first time using
Cassandra.

2017-03-19 19:16 GMT-07:00 Max Campos <mc_cassan...@core43.com>:

> These commands don’t really mean anything unless you’re using
> authentication.  If you want to enable roles / authentication / etc, then
> follow the instructions in the manual:
>
> http://cassandra.apache.org/doc/latest/operating/security.
> html#authentication
>
> … or if you don’t want to use user authentication, then I wouldn’t worry
> about creating users / messing around with roles for the authentication
> system you don’t want to use.  :-)
>
> - Max
>
> On Mar 19, 2017, at 6:56 pm, Long Quanzheng <prc...@gmail.com> wrote:
>
> Hi
> I can't do any actions even with the superuser "cassandra".
>
> cassandra@cqlsh> list roles;
> Unauthorized: Error from server: code=2100 [Unauthorized] message="You
> have to be logged in and not anonymous to perform this request"
>
> cassandra@cqlsh> CREATE USER dba WITH PASSWORD 'bacon' SUPERUSER;
> Unauthorized: Error from server: code=2100 [Unauthorized] message="Only
> superusers can create a role with superuser status"
>
> cassandra.yaml is configed as:
>
> authenticator: AllowAllAuthenticator
>
>
>
>


Error of "You have to be logged in and not anonymous to perform this request"

2017-03-19 Thread Long Quanzheng
Hi
I can't do any actions even with the superuser "cassandra".

cassandra@cqlsh> list roles;
Unauthorized: Error from server: code=2100 [Unauthorized] message="You have
to be logged in and not anonymous to perform this request"

cassandra@cqlsh> CREATE USER dba WITH PASSWORD 'bacon' SUPERUSER;
Unauthorized: Error from server: code=2100 [Unauthorized] message="Only
superusers can create a role with superuser status"

cassandra.yaml is configed as:

authenticator: AllowAllAuthenticator


Re: Running cassandra

2017-03-19 Thread Long Quanzheng
Hi
I can start my cassandra but I can't do any actions even with the superuser
"cassandra".

cassandra@cqlsh> list roles;
Unauthorized: Error from server: code=2100 [Unauthorized] message="You have
to be logged in and not anonymous to perform this request"

cassandra@cqlsh> CREATE USER dba WITH PASSWORD 'bacon' SUPERUSER;
Unauthorized: Error from server: code=2100 [Unauthorized] message="Only
superusers can create a role with superuser status"

cassandra.yaml is configed as:

authenticator: AllowAllAuthenticator




2017-03-19 10:48 GMT-07:00 benjamin roth <brs...@gmail.com>:

> You're welcome!
>
> 2017-03-19 18:41 GMT+01:00 Long Quanzheng <prc...@gmail.com>:
>
>> You are RIGHT!
>> It's working after I remove the env variable GREP_OPTIONS.
>>
>> Thanks!
>>
>> 2017-03-19 10:08 GMT-07:00 benjamin roth <brs...@gmail.com>:
>>
>>> I once had the same problem. In my case it was the coloured output of
>>> grep that injected ansi codes into the CS startup command.
>>>
>>> Am 19.03.2017 18:07 schrieb "Long Quanzheng" <prc...@gmail.com>:
>>>
>>>> Hi
>>>> It still doesn't work.
>>>>
>>>> The real problem is this error:
>>>>
>>>> Error: Could not find or load main class -ea
>>>>
>>>> Thanks
>>>> Long
>>>>
>>>> On Sun, Mar 19, 2017 at 3:16 AM Vinci <vi...@protonmail.com> wrote:
>>>>
>>>>> You need to have a log directory to be able to run cassandra.
>>>>>
>>>>> mkdir logs
>>>>>
>>>>> then start the cassandra process.
>>>>>
>>>>>  Original Message 
>>>>> Subject: Running cassandra
>>>>> Local Time: 19 March 2017 11:31 AM
>>>>> UTC Time: 19 March 2017 06:01
>>>>> From: prc...@gmail.com
>>>>> To: user@cassandra.apache.org <user@cassandra.apache.org>
>>>>>
>>>>>
>>>>> Hi
>>>>> I am trying to get started to play with Cassandra follow this doc:
>>>>> http://cassandra.apache.org/doc/latest/getting_started/insta
>>>>> lling.html#prerequisites
>>>>>
>>>>> But I always get the error:
>>>>>
>>>>> qlong@~/ws/cas/apache-cassandra-3.10 $ ./bin/cassandra -f
>>>>> Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file
>>>>> ./bin/../logs/gc.log due to No such file or directory
>>>>>
>>>>> Error: Could not find or load main class -ea
>>>>> qlong@~/ws/cas/apache-cassandra-3.10 $ ./bin/cassandra
>>>>> Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file
>>>>> ./bin/../logs/gc.log due to No such file or directory
>>>>>
>>>>> qlong@~/ws/cas/apache-cassandra-3.10 $ Error: Could not find or load
>>>>> main class -ea
>>>>>
>>>>> Did I miss something?
>>>>>
>>>>> My java is 1.8:
>>>>> qlong@~ $ java -version
>>>>> java version "1.8.0_121"
>>>>> Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
>>>>> Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
>>>>>
>>>>> Thanks for any help,
>>>>> Long
>>>>>
>>>>>
>>>>>
>>
>


Re: Running cassandra

2017-03-19 Thread Long Quanzheng
You are RIGHT!
It's working after I remove the env variable GREP_OPTIONS.

Thanks!

2017-03-19 10:08 GMT-07:00 benjamin roth <brs...@gmail.com>:

> I once had the same problem. In my case it was the coloured output of grep
> that injected ansi codes into the CS startup command.
>
> Am 19.03.2017 18:07 schrieb "Long Quanzheng" <prc...@gmail.com>:
>
>> Hi
>> It still doesn't work.
>>
>> The real problem is this error:
>>
>> Error: Could not find or load main class -ea
>>
>> Thanks
>> Long
>>
>> On Sun, Mar 19, 2017 at 3:16 AM Vinci <vi...@protonmail.com> wrote:
>>
>>> You need to have a log directory to be able to run cassandra.
>>>
>>> mkdir logs
>>>
>>> then start the cassandra process.
>>>
>>>  Original Message 
>>> Subject: Running cassandra
>>> Local Time: 19 March 2017 11:31 AM
>>> UTC Time: 19 March 2017 06:01
>>> From: prc...@gmail.com
>>> To: user@cassandra.apache.org <user@cassandra.apache.org>
>>>
>>>
>>> Hi
>>> I am trying to get started to play with Cassandra follow this doc:
>>> http://cassandra.apache.org/doc/latest/getting_started/insta
>>> lling.html#prerequisites
>>>
>>> But I always get the error:
>>>
>>> qlong@~/ws/cas/apache-cassandra-3.10 $ ./bin/cassandra -f
>>> Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file
>>> ./bin/../logs/gc.log due to No such file or directory
>>>
>>> Error: Could not find or load main class -ea
>>> qlong@~/ws/cas/apache-cassandra-3.10 $ ./bin/cassandra
>>> Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file
>>> ./bin/../logs/gc.log due to No such file or directory
>>>
>>> qlong@~/ws/cas/apache-cassandra-3.10 $ Error: Could not find or load
>>> main class -ea
>>>
>>> Did I miss something?
>>>
>>> My java is 1.8:
>>> qlong@~ $ java -version
>>> java version "1.8.0_121"
>>> Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
>>> Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
>>>
>>> Thanks for any help,
>>> Long
>>>
>>>
>>>


Re: Running cassandra

2017-03-19 Thread Long Quanzheng
Hi
It still doesn't work.

The real problem is this error:

Error: Could not find or load main class -ea

Thanks
Long

On Sun, Mar 19, 2017 at 3:16 AM Vinci  wrote:

> You need to have a log directory to be able to run cassandra.
>
> mkdir logs
>
> then start the cassandra process.
>
>  Original Message 
> Subject: Running cassandra
> Local Time: 19 March 2017 11:31 AM
> UTC Time: 19 March 2017 06:01
> From: prc...@gmail.com
> To: user@cassandra.apache.org 
>
>
> Hi
> I am trying to get started to play with Cassandra follow this doc:
>
> http://cassandra.apache.org/doc/latest/getting_started/installing.html#prerequisites
>
> But I always get the error:
>
> qlong@~/ws/cas/apache-cassandra-3.10 $ ./bin/cassandra -f
> Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file
> ./bin/../logs/gc.log due to No such file or directory
>
> Error: Could not find or load main class -ea
> qlong@~/ws/cas/apache-cassandra-3.10 $ ./bin/cassandra
> Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file
> ./bin/../logs/gc.log due to No such file or directory
>
> qlong@~/ws/cas/apache-cassandra-3.10 $ Error: Could not find or load main
> class -ea
>
> Did I miss something?
>
> My java is 1.8:
> qlong@~ $ java -version
> java version "1.8.0_121"
> Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
> Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
>
> Thanks for any help,
> Long
>
>
>


Running cassandra

2017-03-19 Thread Long Quanzheng
Hi
I am trying to get started to play with Cassandra follow this doc:
http://cassandra.apache.org/doc/latest/getting_started/installing.html#prerequisites

But I always get the error:

qlong@~/ws/cas/apache-cassandra-3.10 $ ./bin/cassandra -f
Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file
./bin/../logs/gc.log due to No such file or directory

Error: Could not find or load main class -ea
qlong@~/ws/cas/apache-cassandra-3.10 $ ./bin/cassandra
Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file
./bin/../logs/gc.log due to No such file or directory

qlong@~/ws/cas/apache-cassandra-3.10 $ Error: Could not find or load main
class -ea

Did I miss something?

My java is 1.8:
qlong@~ $ java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

Thanks for any help,
Long


Running cassandra

2017-03-18 Thread Long Quanzheng
Hi anyone,
I am trying to get started to play with Cassandra follow this doc:
http://cassandra.apache.org/doc/latest/getting_started/installing.html#prerequisites

But I always get the error:

qlong@~/ws/cas/apache-cassandra-3.10 $ ./bin/cassandra -f
Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file
./bin/../logs/gc.log due to No such file or directory

Error: Could not find or load main class -ea
qlong@~/ws/cas/apache-cassandra-3.10 $ ./bin/cassandra
Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file
./bin/../logs/gc.log due to No such file or directory

qlong@~/ws/cas/apache-cassandra-3.10 $ Error: Could not find or load main
class -ea

Did I miss something?

My java is 1.8:
qlong@~ $ java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

Thanks for any help,
Long