[
https://issues.apache.org/jira/browse/CASSANDRA-781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12831668#action_12831668
]
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/StorageProxy.java
$ patch -p1 <0002-fix-slices-over-non-trivial-wrapped-ranges.txt
patching file src/java/org/apache/cassandra/db/ColumnFamilyStore.java
Hunk #1 succeeded at 43 (offset 1 line).
Hunk #2 succeeded at 1075 (offset 2 lines).
patching file src/java/org/apache/cassandra/dht/AbstractBounds.java
Hunk #1 FAILED at 29.
1 out of 1 hunk FAILED -- saving rejects to file
src/java/org/apache/cassandra/dht/AbstractBounds.java.rej
patching file src/java/org/apache/cassandra/dht/Bounds.java
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/Bounds.java.rej
patching file src/java/org/apache/cassandra/dht/Range.java
patching file src/java/org/apache/cassandra/service/StorageProxy.java
patching file src/java/org/apache/cassandra/service/StorageService.java
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/StorageService.java.rej
patching file test/unit/org/apache/cassandra/dht/BoundsTest.java
patching file test/unit/org/apache/cassandra/dht/RangeTest.java
$
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("10.212.87.165", 9160)
transport = TTransport.TBufferedTransport(socket)
protocol = TBinaryProtocol.TBinaryProtocolAccelerated(transport)
client = Cassandra.Client(protocol)
transport.open()
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)
keys.add(key)
# 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:
keys.discard(row.key)
# 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 test_bug_simple.py
Traceback (most recent call last):
File "test_bug_simple.py", 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/Cassandra.py",
line 486, in get_range_slice
File "/usr/local/python//lib/python2.6/site-packages/cassandra/Cassandra.py",
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
1375137
INFO 21:02:08,933 Starting up server gossip
INFO 21:02:09,118 Cassandra starting up...
INFO 21:02:10,686 Node /10.212.230.176 is now part of the cluster
INFO 21:02:11,750 InetAddress /10.212.230.176 is now UP
INFO 21:05:43,927 scanning node range (136351045523563703929320485474511375137,
20118706661854036583649958139769313744]
ERROR 21:05:43,927 Internal error processing get_range_slice
java.lang.AssertionError
at org.apache.cassandra.dht.Bounds.<init>(Bounds.java:16)
at org.apache.cassandra.dht.Bounds.restrictTo(Bounds.java:34)
at org.apache.cassandra.service.StorageProxy.getRangeSlice(StorageProxy.
java:559)
at org.apache.cassandra.thrift.CassandraServer.get_range_slice(Cassandra
Server.java:560)
at org.apache.cassandra.thrift.Cassandra$Processor$get_range_slice.proce
ss(Cassandra.java:1189)
at org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.jav
a:984)
at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadP
oolServer.java:253)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)
at java.lang.Thread.run(Thread.java:619)
> in a cluster, get_range_slice() does not return all the keys it should
> ----------------------------------------------------------------------
>
> Key: CASSANDRA-781
> URL: https://issues.apache.org/jira/browse/CASSANDRA-781
> 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:
> http://www.mail-archive.com/[email protected]/msg01474.html
> 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:
> http://www.mail-archive.com/[email protected]/msg02423.html
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.