cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryan King (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CASSANDRA-920) Deleting and re-inserting row causes error in get_slice count parameter
Date Thu, 08 Apr 2010 21:04:36 GMT

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

Ryan King commented on CASSANDRA-920:
-------------------------------------

I've rewritten this in terms of our cassandra.gem test suite and can't seem to find a bug
in the client. It fails on the last line.

{code}
    @twitter.insert(:StatusRelationships, key,  {'user_timelines' => {@uuids[0] => 'Item
0', @uuids[1] => 'Item 1', @uuids[2] => 'Item 2'}})
    @twitter.remove(:StatusRelationships, key)

    items = @twitter.get(:StatusRelationships, key, 'user_timelines')
    assert_equal 0, items.size

    @twitter.insert(:StatusRelationships, key,
        {'user_timelines' => {@uuids[2] => 'Item 2', @uuids[3] => 'Item 3', @uuids[4]
=> 'Item 4'}})

    items = @twitter.get(:StatusRelationships, key, 'user_timelines')
    assert_equal 3, items.size

    items = @twitter.get(:StatusRelationships,key,'user_timelines',:count => 3)
    assert_equal 3, items.size 
{code}

And the server logs for this whole test:

{code}
DEBUG - batch_mutate
DEBUG - insert writing local key test_get_super_sub_keys_with_count_after_remove
DEBUG - remove
DEBUG - insert writing local key test_get_super_sub_keys_with_count_after_remove
DEBUG - multiget_slice
DEBUG - weakreadlocal reading SliceFromReadCommand(table='Twitter', key='test_get_super_sub_keys_with_count_after_remove',
column_parent='QueryPath(columnFamilyName='StatusRelationships', superColumnName='[B@746a63d3',
columnName='null')', start='', finish='', reversed=false, count=100)
DEBUG - batch_mutate
DEBUG - insert writing local key test_get_super_sub_keys_with_count_after_remove
DEBUG - multiget_slice
DEBUG - weakreadlocal reading SliceFromReadCommand(table='Twitter', key='test_get_super_sub_keys_with_count_after_remove',
column_parent='QueryPath(columnFamilyName='StatusRelationships', superColumnName='[B@3bd840d9',
columnName='null')', start='', finish='', reversed=false, count=100)
DEBUG - collecting 93814000-b668-11b2-8e6a-06dc05f11207:false:6@1270760311002397
DEBUG - collecting 13814000-4eff-11b3-88b0-351600af16aa:false:6@1270760311002397
DEBUG - collecting 13814000-802c-11b4-8782-bede78b81183:false:6@1270760311069304
DEBUG - collecting 13814000-e286-11b6-9ea9-48a9edd974b6:false:6@1270760311069304
DEBUG - collecting 13814000-a73a-11bb-8a14-b8d289de6d53:false:6@1270760311069304
DEBUG - multiget_slice
DEBUG - weakreadlocal reading SliceFromReadCommand(table='Twitter', key='test_get_super_sub_keys_with_count_after_remove',
column_parent='QueryPath(columnFamilyName='StatusRelationships', superColumnName='[B@6e37d490',
columnName='null')', start='', finish='', reversed=false, count=3)
DEBUG - collecting 93814000-b668-11b2-8e6a-06dc05f11207:false:6@1270760311002397
DEBUG - collecting 13814000-4eff-11b3-88b0-351600af16aa:false:6@1270760311002397
DEBUG - collecting 13814000-802c-11b4-8782-bede78b81183:false:6@1270760311069304
DEBUG - GC for ParNew: 7 ms, 20659648 reclaimed leaving 19819056 used; max is 1211826176
{code}

And the thrift structures for the failing multiget_slice

{code}
<CassandraThrift::ColumnParent column_family:"StatusRelationships", super_column:"user_timelines">
<CassandraThrift::SlicePredicate slice_range:<CassandraThrift::SliceRange start:"",
finish:"", reversed:false, count:3>>
{code}


> Deleting and re-inserting row causes error in get_slice count parameter
> -----------------------------------------------------------------------
>
>                 Key: CASSANDRA-920
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-920
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.5, 0.6
>         Environment: Mac OS/ Java 6
>            Reporter: Bob Florian
>            Assignee: Brandon Williams
>            Priority: Minor
>             Fix For: 0.6.1
>
>         Attachments: 0001_add_system_test.txt
>
>
> I've found that when I delete an entire row in a column family with super columns, and
then re-insert values with the same row and super column keys, the count parameter to the
get_slice call no longer works properly.  Its like it is still counting the deleted columns,
but only returning the new columns.
> The following example uses the Ruby Cassandra client (see link below), but I've seen
the same behavior with the Java Thrift interface.
> Test code:
> --------------
> require 'rubygems'
> require 'cassandra'
> cc = Cassandra.new('Keyspace1')
> cc.insert(:Super1,'test-key1',{'bucket1' => {'1' => 'Item 1', '2' => 'Item 2',
'5' => 'Item 5'}})
> items = cc.get(:Super1,'test-key1','bucket1')
> puts "returned #{items.size} items, should be 3"
> cc.remove(:Super1,'test-key1')
> items = cc.get(:Super1,'test-key1','bucket1')
> puts "returned #{items.size} items, should be 0"
> cc.insert(:Super1,'test-key1',{'bucket1' => {'3' => 'Item 3', '4' => 'Item 4',
'6' => 'Item 6'}})
> items = cc.get(:Super1,'test-key1','bucket1')
> puts "returned #{items.size} items, should be 3"
> items = cc.get(:Super1,'test-key1','bucket1',:count => 3)
> puts "returned #{items.size} items, should be 3"
> items = cc.get(:Super1,'test-key1','bucket1',:count => 4)
> puts "returned #{items.size} items, should be 3"
> items = cc.get(:Super1,'test-key1','bucket1',:count => 5)
> puts "returned #{items.size} items, should be 3"
> items = cc.get(:Super1,'test-key1','bucket1',:count => 6)
> puts "returned #{items.size} items, should be 3"
> Output:
> returned 3 items, should be 3
> returned 0 items, should be 0
> returned 3 items, should be 3
> returned 1 items, should be 3
> returned 2 items, should be 3
> returned 2 items, should be 3
> returned 3 items, should be 3
> Ruby library link:
> http://blog.evanweaver.com/files/doc/fauna/cassandra/files/README_rdoc.html

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


Mime
View raw message