[
https://issues.apache.org/jira/browse/CASSANDRA-4835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13480397#comment-13480397
]
Krzysztof Cieslinski commented on CASSANDRA-4835:
-------------------------------------------------
Ok, thanks, but I'm afraid that the fact, that my appends are in same order as
in BATCH is not a result of a random chance, due the fact that i did this test
using BATCH that contains 5000 update commands. And all of them(these 5000
values in list) are in same order as update commands in BATCH(i have executed
this test ~10 times and result was always same). However prepending new items
is totally random even for BATCH that contains 10 or less updates.. So this
shows that for sure, order of updates execution is different for BATCH with
prependings and BATCH with appendings.
> 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
> 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