You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jonathan Ellis (JIRA)" <ji...@apache.org> on 2012/10/23 22:19:13 UTC

[jira] [Reopened] (CASSANDRA-4835) Appending/Prepending items to list using BATCH

     [ https://issues.apache.org/jira/browse/CASSANDRA-4835?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis reopened CASSANDRA-4835:
---------------------------------------

      Assignee: Sylvain Lebresne

Sylvain points out that we actually do expect update order to be preserved *within the same row*.  Reopening.
                
> Appending/Prepending items to list using BATCH
> ----------------------------------------------
>
>                 Key: CASSANDRA-4835
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4835
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.2.0 beta 1
>            Reporter: Krzysztof Cieslinski
>            Assignee: Sylvain Lebresne
>            Priority: Minor
>
> As I know, there is no any guarantee that commands that are inside BATCH block will execute in same order, as they are stored in the BATCH block. But...
> I have made two tests:
> First appends some items to the empty list, and the second one, prepends items, also to the empty list. Both of them are using UPDATE commands stored in the BATCH block. 
> Results of those tests are as follow:
> First:
>       When appending new items to list, USING commands are executed in the same order as they are stored i BATCH.
> Second:
>       When prepending new items to list, USING commands are executed in random order.  
> So, in other words below code:
> {code:xml}
> BEGIN BATCH
>  UPDATE... list_name = list_name + [ '1' ]  
>  UPDATE... list_name = list_name + [ '2' ]
>  UPDATE... list_name = list_name + [ '3' ] 
> APPLY BATCH;{code}
>  always results in [ '1', '2', '3' ],
>  but this code:
> {code:xml}
> BEGIN BATCH
>  UPDATE... list_name = [ '1' ] + list_name   
>  UPDATE... list_name = [ '2' ] + list_name
>  UPDATE... list_name = [ '3' ] + list_name
> APPLY BATCH;{code}
> results in randomly ordered list, like [ '2', '1', '3' ]    (expected result is [ '3', '2', '1' ])
> So somehow, when appending items to list, commands from BATCH are executed in order as they are stored, but when prepending, the order is random.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira