Krzysztof Cieslinski created CASSANDRA-4835:
-----------------------------------------------
Summary: 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