cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "bjc (JIRA)" <>
Subject [jira] Commented: (CASSANDRA-781) in a cluster, get_range_slice() does not return all the keys it should
Date Tue, 09 Feb 2010 21:09:27 GMT


bjc commented on CASSANDRA-781:

Ok, I checked out a fresh copy of trunk and applied both new patches (0001 and 0002). There
were some errors for 0002, but upon looking at the code it seems parts of the patch have already
been committed to the SVN repo, so what I ended up with is the right thing.

$ patch -p1 <0001-fix-timeout-bug.txt 
patching file src/java/org/apache/cassandra/service/
$ patch -p1 <0002-fix-slices-over-non-trivial-wrapped-ranges.txt
patching file src/java/org/apache/cassandra/db/
Hunk #1 succeeded at 43 (offset 1 line).
Hunk #2 succeeded at 1075 (offset 2 lines).
patching file src/java/org/apache/cassandra/dht/
Hunk #1 FAILED at 29.
1 out of 1 hunk FAILED -- saving rejects to file src/java/org/apache/cassandra/dht/
patching file src/java/org/apache/cassandra/dht/
Hunk #1 FAILED at 1.
Hunk #2 FAILED at 11.
2 out of 2 hunks FAILED -- saving rejects to file src/java/org/apache/cassandra/dht/
patching file src/java/org/apache/cassandra/dht/
patching file src/java/org/apache/cassandra/service/
patching file src/java/org/apache/cassandra/service/
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
3 out of 3 hunks ignored -- saving rejects to file src/java/org/apache/cassandra/service/
patching file test/unit/org/apache/cassandra/dht/
patching file test/unit/org/apache/cassandra/dht/

Copied my storage-conf.xml into place, which has only two changes: Seeds defined and binding
addresses changed to null strings. Thus, my RF is 1 now, not 2 as it was before.

I now use your simpler test. Here is the test with all the import statements:

import uuid

from thrift import Thrift
from thrift.transport import TTransport
from thrift.transport import TSocket
from thrift.protocol.TBinaryProtocol import TBinaryProtocolAccelerated
from cassandra import Cassandra
from cassandra.ttypes import *

num_keys = 10

socket = TSocket.TSocket("", 9160)
transport = TTransport.TBufferedTransport(socket)
protocol = TBinaryProtocol.TBinaryProtocolAccelerated(transport)
client = Cassandra.Client(protocol)

ks = "Keyspace1"
cf = "Super1"
path = ColumnPath(cf, "foo", "is")
value = "cool"

# insert, record keys in `keys` set
keys = set()
for i in xrange(100):
    key = uuid.uuid4().hex
    client.insert(ks, key, path, value, 0, ConsistencyLevel.ONE)

# remove keys found from set
parent = ColumnParent(column_family=cf)
slice_range = SliceRange(start="key", finish="key")
predicate = SlicePredicate(slice_range=slice_range)
result = client.get_range_slice(ks, parent, predicate, "", "", 1000, ConsistencyLevel.ONE)
for row in result:

# if there are any left over, there is a bug
assert not keys, list(sorted(keys))

I cleared out the data/commitlog dirs and launched both nodes. The tokens:

 INFO 21:02:08,768 Saved Token not found. Using 136351045523563703929320485474511375137
 INFO 21:02:09,509 Saved Token not found. Using 20118706661854036583649958139769313744

Now.. run the test!

$ python
Traceback (most recent call last):
  File "", line 36, in <module>
    result = client.get_range_slice(ks, parent, predicate, "", "", 1000, ConsistencyLevel.ONE)

  File "/usr/local/python//lib/python2.6/site-packages/cassandra/", line 486,
in get_range_slice
  File "/usr/local/python//lib/python2.6/site-packages/cassandra/", line 508,
in recv_get_range_slice
thrift.Thrift.TApplicationException: Internal error processing get_range_slice

The log from the node I am querying:

 INFO 21:02:08,768 Saved Token not found. Using 13635104552356370392932048547451
 INFO 21:02:08,933 Starting up server gossip
 INFO 21:02:09,118 Cassandra starting up...
 INFO 21:02:10,686 Node / is now part of the cluster
 INFO 21:02:11,750 InetAddress / is now UP
 INFO 21:05:43,927 scanning node range (136351045523563703929320485474511375137,
ERROR 21:05:43,927 Internal error processing get_range_slice
        at org.apache.cassandra.dht.Bounds.<init>(
        at org.apache.cassandra.dht.Bounds.restrictTo(
        at org.apache.cassandra.service.StorageProxy.getRangeSlice(StorageProxy.
        at org.apache.cassandra.thrift.CassandraServer.get_range_slice(Cassandra
        at org.apache.cassandra.thrift.Cassandra$Processor$get_range_slice.proce
        at org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.jav
        at org.apache.thrift.server.TThreadPoolServer$
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
        at java.util.concurrent.ThreadPoolExecutor$

> in a cluster, get_range_slice() does not return all the keys it should
> ----------------------------------------------------------------------
>                 Key: CASSANDRA-781
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.5
>         Environment: Debian 5 lenny on EC2, Gentoo linux, Windows XP
>            Reporter: bjc
>            Assignee: Jonathan Ellis
>             Fix For: 0.5, 0.6
>         Attachments: 0001-fix-timeout-bug.txt, 0002-fix-slices-over-non-trivial-wrapped-ranges.txt
> get_range_slice() does not return the same set of keys as get_key_range() in 0.5.0 final.
> I posted a program to reproduce the behavior:
> Apparently, you must have more than one node to get the behavior. Also, it may depend
on the locations of the nodes on the ring.. I.e., if you don't generate enough keys randomly,
then by chance they could all fall on the same host and you might not see the behavior, although
I was able to get it to happen using only 2 nodes and 10 keys.
> Here are the other emails describing the issue:

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

View raw message