You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Rajat Chopra <rc...@makara.com> on 2010/12/16 06:45:12 UTC

get_range_slices does not work properly

Hi!
   Using v0.6.6, I have a 16 node cluster.
One column family has 16 keys(corresponding to node number) but only 9 get listed with get_range_slices with a predicate and a key_range with empty start and end.
When I do a get_slice with one of the keys that I know is there (but not listed by get_range_slices) I do get the column slice.

This happens with CL.ALL !

Sample code (python):

cp = ColumnParent('summary')
col_slice = SliceRange(start="", finish="", count=500)
predicate = SlicePredicate(slice_range=col_slice)
keyrange = KeyRange(start_key="", end_key="")
slices = client.get_range_slices('cf_name', cp, predicate, keyrange, ConsistencyLevel.ALL)
print "Found following rows : \n    %s"  %  [k.key for k in slices]

>> This prints the following ->
Found following rows:
    ['3', '5', '12', '9', '14', '4', '15', '11', '7']
>> I was expecting ->
   ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16'] or some byte sorted order.

>> Now this code ->

slice1 = s.client.get_slice('cf_name', '1', cp, predicate, ConsistencyLevel.ALL)
print  "found  column for key 1 = %s"  %  struct.unpack("!Q", slice1[0].column.name)[0]

>> It prints what I expected:
found  column for key 1 = 1292454020 ('1292454020' is some column name which is good)



Also, when I do a nodetool ring, I see only 15 nodes instead of 16, even from the node that is not listed.

Please help.
Thanks,
Rajat


Re: get_range_slices does not work properly

Posted by Nick Bailey <ni...@riptano.com>.
Looks like the patch that introduced that bug was added in 0.6.6 and wasn't
fixed until 0.6.8 so yes I'd say that is your problem with get_range_slices.
Is there a reason you can't update?

For nodetool ring, if every node in your cluster is not showing one of the
nodes in the ring, then that node is likely not participating. It is
possible for the cassandra process to still be running and responding to
nodetool but not gossipping or participating. This is actually what happens
when you decommission a node. It won't kill the cassandra process, you need
to do that manually.

If you have not run decommission on the node that is not participating, can
you examine the log and see if there are any errors indicating why the node
stopped gossipping? It might also be useful to look at the logs on the other
machines and see when they remove that node from the ring.

On Wed, Dec 15, 2010 at 11:51 PM, Rajat Chopra <rc...@makara.com> wrote:

> Is this https://issues.apache.org/jira/browse/CASSANDRA-1722 related?
>
>
>
>
>
>
>
>
>
>
>
> *From:* Rajat Chopra [mailto:rchopra@makara.com]
> *Sent:* Wednesday, December 15, 2010 9:45 PM
> *To:* user@cassandra.apache.org
> *Subject:* get_range_slices does not work properly
>
>
>
> Hi!
>
>    Using v0.6.6, I have a 16 node cluster.
>
> One column family has 16 keys(corresponding to node number) but only 9 get
> listed with get_range_slices with a predicate and a key_range with empty
> start and end.
>
> When I do a get_slice with one of the keys that I know is there (but not
> listed by get_range_slices) I do get the column slice.
>
>
>
> This happens with CL.ALL !
>
>
>
> Sample code (python):
>
>
>
> cp = ColumnParent('summary')
>
> col_slice = SliceRange(start="", finish="", count=500)
>
> predicate = SlicePredicate(slice_range=col_slice)
>
> keyrange = KeyRange(start_key="", end_key="")
>
> slices = client.get_range_slices('cf_name', cp, predicate, keyrange,
> ConsistencyLevel.ALL)
>
> print "Found following rows : \n    %s"  %  [k.key for k in slices]
>
>
>
> >> This prints the following ->
>
> Found following rows:
>
>     ['3', '5', '12', '9', '14', '4', '15', '11', '7']
>
> >> I was expecting ->
>
>    [‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’, ‘10’, ‘11’, ‘12’, ‘13’,
> ‘14’, ‘15’, ‘16’] or some byte sorted order.
>
>
>
> >> Now this code ->
>
>
>
> slice1 = s.client.get_slice('cf_name', '1', cp, predicate,
> ConsistencyLevel.ALL)
>
> print  "found  column for key 1 = %s"  %  struct.unpack("!Q", slice1[0].
> column.name)[0]
>
>
>
> >> It prints what I expected:
>
> found  column for key 1 = 1292454020 (‘1292454020’ is some column name
> which is good)
>
>
>
>
>
>
>
> Also, when I do a nodetool ring, I see only 15 nodes instead of 16, even
> from the node that is not listed.
>
>
>
> Please help.
>
> Thanks,
>
> Rajat
>
>
>

RE: get_range_slices does not work properly

Posted by Rajat Chopra <rc...@makara.com>.
Is this https://issues.apache.org/jira/browse/CASSANDRA-1722 related?








From: Rajat Chopra [mailto:rchopra@makara.com]
Sent: Wednesday, December 15, 2010 9:45 PM
To: user@cassandra.apache.org
Subject: get_range_slices does not work properly

Hi!
   Using v0.6.6, I have a 16 node cluster.
One column family has 16 keys(corresponding to node number) but only 9 get listed with get_range_slices with a predicate and a key_range with empty start and end.
When I do a get_slice with one of the keys that I know is there (but not listed by get_range_slices) I do get the column slice.

This happens with CL.ALL !

Sample code (python):

cp = ColumnParent('summary')
col_slice = SliceRange(start="", finish="", count=500)
predicate = SlicePredicate(slice_range=col_slice)
keyrange = KeyRange(start_key="", end_key="")
slices = client.get_range_slices('cf_name', cp, predicate, keyrange, ConsistencyLevel.ALL)
print "Found following rows : \n    %s"  %  [k.key for k in slices]

>> This prints the following ->
Found following rows:
    ['3', '5', '12', '9', '14', '4', '15', '11', '7']
>> I was expecting ->
   ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16'] or some byte sorted order.

>> Now this code ->

slice1 = s.client.get_slice('cf_name', '1', cp, predicate, ConsistencyLevel.ALL)
print  "found  column for key 1 = %s"  %  struct.unpack("!Q", slice1[0].column.name)[0]

>> It prints what I expected:
found  column for key 1 = 1292454020 ('1292454020' is some column name which is good)



Also, when I do a nodetool ring, I see only 15 nodes instead of 16, even from the node that is not listed.

Please help.
Thanks,
Rajat