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

Ngoc Minh Vo commented on CASSANDRA-11368:
------------------------------------------

Hello,

We encounter the same issue randomly on our production setup with two 
datacenters using C* v2.0.14. No problem on one-datacenter UAT environment.

I believe that coordinator node sends insert query to two datacenters with the 
same timestamp. Hence, data spreading process inter-datacenter could lead to 
duplicated values in list.

Two possible solutions:
1. use "map<Integer, V>" with keys corresponding to the value indexes (i.e.: 0, 
1, 2, ... N)
2. use blob to store all list values and perform deserialization on client side 
(via DAO layer for instance)

Any other recommendation?
Thanks for your help.
Minh

> Lists inserts are not truly idempotent
> --------------------------------------
>
>                 Key: CASSANDRA-11368
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11368
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Thanh
>
> List of UDT can't be updated properly when using USING TIMESTAMP
> Observe:
> {code}
> cqlsh:t360> CREATE TYPE fullname ( 
> ... fname text, 
> ... lname text 
> ... );
> cqlsh:t360> CREATE TABLE users ( 
> ... id text PRIMARY KEY, 
> ... names list<frozen <fullname>>, 
> ... phone text 
> ... ); 
> cqlsh:t360> UPDATE users USING TIMESTAMP 1458019725701 SET names = [{ fname: 
> 'fname1', lname: 'lname1'},{ fname: 'fname2', lname: 'lname2'},{ fname: 
> 'fname3', lname: 'lname3'}] WHERE id='a'; 
> cqlsh:t360> select * from users;
> id | names | phone 
> ----+--------------------------------------------------------------------------------------------------------------+-------
>  
> a | [{lname: 'lname1', fname: 'fname1'}, {lname: 'lname2', fname: 'fname2'}, 
> {lname: 'lname3', fname: 'fname3'}] | null
> (1 rows) 
> cqlsh:t360> UPDATE users USING TIMESTAMP 1458019725701 SET names = [{ fname: 
> 'fname1', lname: 'lname1'},{ fname: 'fname2', lname: 'lname2'},{ fname: 
> 'fname3', lname: 'lname3'}] WHERE id='a'; 
> cqlsh:t360> select * from users;
> id | names | phone 
> ----+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------
>  
> a | [{lname: 'lname1', fname: 'fname1'}, {lname: 'lname2', fname: 'fname2'}, 
> {lname: 'lname3', fname: 'fname3'}, {lname: 'lname1', fname: 'fname1'}, 
> {lname: 'lname2', fname: 'fname2'}, {lname: 'lname3', fname: 'fname3'}] | null
> (1 rows)
> {code}
> => the list doesn't get replaced, it gets appended, which is not the 
> expected/desired result



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to