[ 
https://issues.apache.org/jira/browse/CASSANDRA-348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740142#action_12740142
 ] 

Jonathan Ellis commented on CASSANDRA-348:
------------------------------------------

Node selection code is working as designed but it is not quite what getKeyRange 
expects.

The node selection is "pick the node whose token is nearest to the decorated 
key, _always rounding up_."  so what you end up with here is 3 range sections:

["", 000000000] node A (the one with token 00000000)
(00000000, 88888888] node B (the one with token 88888888)
(88888888, infinity) node A again

so, key 00 goes on node A, but 01-88 go on node B.  then 09-ff go on node A 
again.

we could hack around this in getKeyRange but it seems like the Right Fix is to 
make it so A has ['', 88888888) and B has [88888888, inf), no?

what do you think, Jun?  is there any inherent advantage to "round up" instead 
of "round down" that I have forgotten?

[yeah, we're ignoring RackAware for now]

> Range scan over two nodes returns wrong data
> --------------------------------------------
>
>                 Key: CASSANDRA-348
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-348
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.4
>            Reporter: Mark Robson
>         Attachments: 348.diff, setup.cas
>
>
> I've got two nodes with tokens 00000000 and 88888888. I add 16 rows in which 
> are spread over them, then do a key range scan.
> I can scan part of the range successfully, but if I try to scan the entire 
> range of keys (0-f) then I get unexpected results
> ./Cassandra-remote -h localhost:9160 get_key_range Keyspace1 Standard1 0 31 
> 1000
> ['00', '01', '10', '11', '20', '21', '30', '31']
> ./Cassandra-remote -h localhost:9160 get_key_range Keyspace1 Standard1 3 81 
> 1000
> ['30', '31', '40', '41', '50', '51', '60', '61', '70', '71', '80', '81']
>  ./Cassandra-remote -h localhost:9160 get_key_range Keyspace1 Standard1 7 b1 
> 1000
> ['70', '71', '80', '81', '90', '91', 'a0', 'a1', 'b0', 'b1']
> ./Cassandra-remote -h localhost:9160 get_key_range Keyspace1 Standard1 a g 
> 1000
> ['a0', 'a1', 'b0', 'b1', 'c0', 'c1', 'd0', 'd1', 'e0', 'e1', 'f0', 'f1']
> All of which returned as I expected.
> But when I range scan the whole lot (0-g) then I get:
> ./Cassandra-remote -h localhost:9160 get_key_range Keyspace1 Standard1 0 g 
> 1000
> [ '00',
>   '90',
>   '91',
>   'a0',
>   'a1',
>   'b0',
>   'b1',
>   'c0',
>   'c1',
>   'd0',
>   'd1',
>   'e0',
>   'e1',
>   'f0',
>   'f1']
> Where have 01-81 gone?
> I'll attach the data loading script.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to