Re: BATCH UNLOGGED issue with READ-DELETE Commit.

8 views
Skip to first unread message

Atul Saroha

unread,
Aug 8, 2016, 10:06:35 PM8/8/16
to java-dri...@lists.datastax.com

Hi,
I believe that u ment to say it doesn't delete.
Only problem I can think of :
Time is not in sync between client and cassandra nodes. Because of it cassandra says it has applied but changes are not visible. But this problem affects if u have sequential write on same primary key.


On 09-Aug-2016 12:58 AM, "Lakshmikanth Kondapelly" <lakshmikant...@sial.com> wrote:
Hi ,

 I am facing a strange issue with BATCH  UNLOGGED . 

Following is scenario,

 First I am fetching data  from a table in Cassandra and based on the data fetched I send to another resource to load more details during the process I am deleting rows in two tables . This does delete . following is the query ,

BEGIN UNLOGGED BATCH
 DELETE FROM A WHERE  participant_id = 1 and 
store_id = 9;
 DELETE FROM B WHERE  participant_id = 1and 
store_id = 9;
 
 APPLY BATCH;

 Please help to understand what is missing. 

Note : If I ust execute the aobve query works fine . It happens only when read  in process while delete. 

Thanks in advance. 

This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, you must not copy this message or attachment or disclose the contents to any other person. If you have received this transmission in error, please notify the sender immediately and delete the message and any attachment from your system. Merck KGaA, Darmstadt, Germany and any of its subsidiaries do not accept liability for any omissions or errors in this message which may arise as a result of E-Mail-transmission or for damages resulting from any unauthorized changes of the content of this message and any attachment thereto. Merck KGaA, Darmstadt, Germany and any of its subsidiaries do not guarantee that this message is free of viruses and does not accept liability for any damages caused by any virus transmitted therewith.

Click http://www.merckgroup.com/disclaimer to access the German, French, Spanish and Portuguese versions of this disclaimer.

--
You received this message because you are subscribed to the Google Groups "DataStax Java Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-user+unsubscribe@lists.datastax.com.

Lakshmikanth Kondapelly

unread,
Aug 9, 2016, 10:16:51 AM8/9/16
to java-dri...@lists.datastax.com

Thanks for your reply Atul. 

I found the root cause! 

Basically, we fetch the data from a remote system  which is taking some time to render and meanwhile, in another thread we are deleting  the row. Once the data is fetched from the remote system we  call update. This is causing the issue somehow the record is inserted. There is no locking mechanism or validation before updating the record. I am exploring a way to implement . Would appreciate your suggestion on this. 



On Mon, Aug 8, 2016 at 9:06 PM, Atul Saroha <atu...@gmail.com> wrote:

Hi,
I believe that u ment to say it doesn't delete.
Only problem I can think of :
Time is not in sync between client and cassandra nodes. Because of it cassandra says it has applied but changes are not visible. But this problem affects if u have sequential write on same primary key.


On 09-Aug-2016 12:58 AM, "Lakshmikanth Kondapelly" <lakshmikanth.kondapelly@sial.com> wrote:
Hi ,

 I am facing a strange issue with BATCH  UNLOGGED . 

Following is scenario,

 First I am fetching data  from a table in Cassandra and based on the data fetched I send to another resource to load more details during the process I am deleting rows in two tables . This does delete . following is the query ,

BEGIN UNLOGGED BATCH
 DELETE FROM A WHERE  participant_id = 1 and 
store_id = 9;
 DELETE FROM B WHERE  participant_id = 1and 
store_id = 9;
 
 APPLY BATCH;

 Please help to understand what is missing. 

Note : If I ust execute the aobve query works fine . It happens only when read  in process while delete. 

Thanks in advance. 

This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, you must not copy this message or attachment or disclose the contents to any other person. If you have received this transmission in error, please notify the sender immediately and delete the message and any attachment from your system. Merck KGaA, Darmstadt, Germany and any of its subsidiaries do not accept liability for any omissions or errors in this message which may arise as a result of E-Mail-transmission or for damages resulting from any unauthorized changes of the content of this message and any attachment thereto. Merck KGaA, Darmstadt, Germany and any of its subsidiaries do not guarantee that this message is free of viruses and does not accept liability for any damages caused by any virus transmitted therewith.

Click http://www.merckgroup.com/disclaimer to access the German, French, Spanish and Portuguese versions of this disclaimer.

--
You received this message because you are subscribed to the Google Groups "DataStax Java Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-user+unsubscribe@lists.datastax.com.

--
You received this message because you are subscribed to the Google Groups "DataStax Java Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-user+unsubscribe@lists.datastax.com.



--
Thanks,
 LK
(pleasure is limited and happiness is eternal.)

Ryan Svihla

unread,
Aug 9, 2016, 11:12:29 AM8/9/16
to java-dri...@lists.datastax.com
lightweight transactions are where you want to look for that. Reads at SERIAL or LOCAL_SERIAL and writes with conditions on them (IF NOT EXISTS etc) http://www.datastax.com/dev/blog/lightweight-transactions-in-cassandra-2-0

Regards,

Ryan Svihla
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.
Reply all
Reply to author
Forward
0 new messages