Re: IF EXISTS checks on all nodes?

2016-05-12 Thread Siddharth Verma
Hi, I missed out on some info
node 1,2,3 are in DC1
node 4,5,6 are in DC2
and RF is 3
so all data is on all nodes


@Carlos : There was only one query. And yes all nodes have same data for
col5 only
node 6 has
P1,100,A,val1,w1
P1,100,B,val2,w2
P1,200,C,val3,w_x
P1,200,D,val4,w4

node 1,2,3,4,5 have
P1,100,A,val1,w1
P1,100,B,val2,w2
P1,200,C,null,w_x

So, when "consistency all" in cqlsh
1.IF EXISTS is checked ON EVERY NODE before applying, and if it is true on
all, ONLY then it is applied
OR
2. IF EXISTS was true on one, so applied on all.


Re: IF EXISTS checks on all nodes?

2016-05-12 Thread Carlos Rolo
Hello,

As far as I know, lightweight transactions only apply to a single
partition, so in your case it will only execute on the nodes responsible
for that partition. And as a consequence, those nodes will all be in the
same state when the transaction ends (If it would apply).

Please refer to this blog post for more information about the LIghtweigth
transactions:
http://www.datastax.com/dev/blog/lightweight-transactions-in-cassandra-2-0



Regards,

Carlos Juzarte Rolo
Cassandra Consultant / Datastax Certified Architect / Cassandra MVP

Pythian - Love your data

rolo@pythian | Twitter: @cjrolo | Skype: cjr2k3 | Linkedin:
*linkedin.com/in/carlosjuzarterolo
*
Mobile: +351 918 918 100
www.pythian.com

On Thu, May 12, 2016 at 12:17 PM, Siddharth Verma <
verma.siddha...@snapdeal.com> wrote:

> Hi,
> If i have inconsistent data on nodes
> Scenario :
> I have 2 DCs each with 3 nodes
> and I have inconsistent data on them
>
> node 1,2,3,4,5 have
> P1,100,A,val1,w1
> P1,100,B,val2,w2
>
> node 6 has
> P1,100,A,val1,w1
> P1,100,B,val2,w2
> P1,200,C,val3,w3
> P1,200,D,val4,w4
>
> col1, col2, col3,col4,col5 in table
> Primary key (col1, col2, col3)
>
> Now i execute the query from CQLSH
> update mykeyspace.my_table_1 set col5 = 'w_x' where col1='P1' and col2=200
> and col3='C' IF EXISTS;
>
> Is it possible that
> node 1,2,3,4,5 will get the entry
> P1,200,C,null,w_x
>
> I.e. IF EXISTS is checked per node or only once and then execute on all?
>
> Thanks
> Siddharth Verma
>

-- 


--





IF EXISTS checks on all nodes?

2016-05-12 Thread Siddharth Verma
Hi,
If i have inconsistent data on nodes
Scenario :
I have 2 DCs each with 3 nodes
and I have inconsistent data on them

node 1,2,3,4,5 have
P1,100,A,val1,w1
P1,100,B,val2,w2

node 6 has
P1,100,A,val1,w1
P1,100,B,val2,w2
P1,200,C,val3,w3
P1,200,D,val4,w4

col1, col2, col3,col4,col5 in table
Primary key (col1, col2, col3)

Now i execute the query from CQLSH
update mykeyspace.my_table_1 set col5 = 'w_x' where col1='P1' and col2=200
and col3='C' IF EXISTS;

Is it possible that
node 1,2,3,4,5 will get the entry
P1,200,C,null,w_x

I.e. IF EXISTS is checked per node or only once and then execute on all?

Thanks
Siddharth Verma