You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Hiroyuki Yamada <mo...@gmail.com> on 2018/03/24 03:38:15 UTC

LWT on data mutated by non-LWT operation is valid ?

Hi all,

I have some question about LWT.

I am wondering if LWT works only for data mutated by LWT or not.
In other words, doing LWT on some data mutated by non-LWT operations
is still valid ?
I don't fully understand how system.paxos table works in LWT,
but row_key should be empty for a data mutated by non-LWT operation,
so conflict resolution seems impossible.
It works only if a previous non-LWT operation is completely finished ?

Thanks in advance.

Best regards,
Hiroyuki

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
For additional commands, e-mail: user-help@cassandra.apache.org


Re: LWT on data mutated by non-LWT operation is valid ?

Posted by Hiroyuki Yamada <mo...@gmail.com>.
Thank you, JH.
I took a look and probably understand it.

Maybe, in summary,
if all the operations are LWT, there is no issue even if clocks are
drifted, because it's ballot based.
But, if some of the operations are non-LWT and clocks are drifted,
there might be causing issues.
(like overwriting data with previous insert with future time or something)

Anyways, thank you.

Thanks,
Hiro

On Mon, Mar 26, 2018 at 5:42 PM, Jacques-Henri Berthemet
<ja...@genesys.com> wrote:
> If you check the Jira issue I linked you'll see a recent comment describing a potential explanation for my mixed LWT/non-LWT problem. So, it looks like there can be some edge cases.
>
> I'd say that if data was inserted a while ago (seconds) there should be no problems.
>
> --
> Jacques-Henri Berthemet
>
> -----Original Message-----
> From: Hiroyuki Yamada [mailto:mogwaing@gmail.com]
> Sent: Sunday, March 25, 2018 1:10 AM
> To: user@cassandra.apache.org
> Subject: Re: LWT on data mutated by non-LWT operation is valid ?
>
> Thank you JH.
> But, it's still a little bit unclear to me
>
> Let me clarify the question.
> What I wanted to know is whether or not linearizability is sustained by doing LWT  (Consistency: QUORUM, Serial Consistency: SERIAL) on data previously mutated by non-LWT (Consistency: QUORUM).
> I think It should be OK if non-LWT surely correctly happened before the LWT, but I'm wondering if there is a corner case where it's not OK.
>
> For example, to test LWT (Update) operations, initial data should be inserted by LWT operations ? or it can be non-LWT operations ?
>
> Thanks,
> Hiroyuki
>
> On Sat, Mar 24, 2018 at 8:27 PM, Jacques-Henri Berthemet <ja...@genesys.com> wrote:
>> Hi Hiroyuki,
>>
>>
>> For both operations you'll have to provide partition key so "conflict"
>> at DB level can always be resolved.
>>
>> But if two operations, LWT and non-LWT, are racing against each others
>> the result is unpredictable, if non-LWT is applied after LWT the
>> result will be overwritten.
>>
>>
>> It seems mixing LWT and non-LWT can result in strange results, we
>> recently opened a bug on non-working delete after LWT insert:
>> https://issues.apache.org/jira/browse/CASSANDRA-14304
>> .apache.org
>>
>>
>> Regards,
>>
>> JH
>>
>> ________________________________
>> From: Hiroyuki Yamada <mo...@gmail.com>
>> Sent: Saturday, March 24, 2018 4:38:15 AM
>> To: user@cassandra.apache.org
>> Subject: LWT on data mutated by non-LWT operation is valid ?
>>
>> Hi all,
>>
>> I have some question about LWT.
>>
>> I am wondering if LWT works only for data mutated by LWT or not.
>> In other words, doing LWT on some data mutated by non-LWT operations
>> is still valid ?
>> I don't fully understand how system.paxos table works in LWT, but
>> row_key should be empty for a data mutated by non-LWT operation, so
>> conflict resolution seems impossible.
>> It works only if a previous non-LWT operation is completely finished ?
>>
>> Thanks in advance.
>>
>> Best regards,
>> Hiroyuki
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
>> For additional commands, e-mail: user-help@cassandra.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
> For additional commands, e-mail: user-help@cassandra.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
> For additional commands, e-mail: user-help@cassandra.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
For additional commands, e-mail: user-help@cassandra.apache.org


RE: LWT on data mutated by non-LWT operation is valid ?

Posted by Jacques-Henri Berthemet <ja...@genesys.com>.
If you check the Jira issue I linked you'll see a recent comment describing a potential explanation for my mixed LWT/non-LWT problem. So, it looks like there can be some edge cases.

I'd say that if data was inserted a while ago (seconds) there should be no problems.

--
Jacques-Henri Berthemet

-----Original Message-----
From: Hiroyuki Yamada [mailto:mogwaing@gmail.com] 
Sent: Sunday, March 25, 2018 1:10 AM
To: user@cassandra.apache.org
Subject: Re: LWT on data mutated by non-LWT operation is valid ?

Thank you JH.
But, it's still a little bit unclear to me

Let me clarify the question.
What I wanted to know is whether or not linearizability is sustained by doing LWT  (Consistency: QUORUM, Serial Consistency: SERIAL) on data previously mutated by non-LWT (Consistency: QUORUM).
I think It should be OK if non-LWT surely correctly happened before the LWT, but I'm wondering if there is a corner case where it's not OK.

For example, to test LWT (Update) operations, initial data should be inserted by LWT operations ? or it can be non-LWT operations ?

Thanks,
Hiroyuki

On Sat, Mar 24, 2018 at 8:27 PM, Jacques-Henri Berthemet <ja...@genesys.com> wrote:
> Hi Hiroyuki,
>
>
> For both operations you'll have to provide partition key so "conflict" 
> at DB level can always be resolved.
>
> But if two operations, LWT and non-LWT, are racing against each others 
> the result is unpredictable, if non-LWT is applied after LWT the 
> result will be overwritten.
>
>
> It seems mixing LWT and non-LWT can result in strange results, we 
> recently opened a bug on non-working delete after LWT insert:
> https://issues.apache.org/jira/browse/CASSANDRA-14304
> .apache.org
>
>
> Regards,
>
> JH
>
> ________________________________
> From: Hiroyuki Yamada <mo...@gmail.com>
> Sent: Saturday, March 24, 2018 4:38:15 AM
> To: user@cassandra.apache.org
> Subject: LWT on data mutated by non-LWT operation is valid ?
>
> Hi all,
>
> I have some question about LWT.
>
> I am wondering if LWT works only for data mutated by LWT or not.
> In other words, doing LWT on some data mutated by non-LWT operations 
> is still valid ?
> I don't fully understand how system.paxos table works in LWT, but 
> row_key should be empty for a data mutated by non-LWT operation, so 
> conflict resolution seems impossible.
> It works only if a previous non-LWT operation is completely finished ?
>
> Thanks in advance.
>
> Best regards,
> Hiroyuki
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
> For additional commands, e-mail: user-help@cassandra.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
For additional commands, e-mail: user-help@cassandra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
For additional commands, e-mail: user-help@cassandra.apache.org

Re: LWT on data mutated by non-LWT operation is valid ?

Posted by Hiroyuki Yamada <mo...@gmail.com>.
Thank you JH.
But, it's still a little bit unclear to me

Let me clarify the question.
What I wanted to know is whether or not linearizability is sustained
by doing LWT  (Consistency: QUORUM, Serial Consistency: SERIAL) on
data previously mutated by non-LWT (Consistency: QUORUM).
I think It should be OK if non-LWT surely correctly happened before the LWT,
but I'm wondering if there is a corner case where it's not OK.

For example, to test LWT (Update) operations,
initial data should be inserted by LWT operations ? or it can be
non-LWT operations ?

Thanks,
Hiroyuki

On Sat, Mar 24, 2018 at 8:27 PM, Jacques-Henri Berthemet
<ja...@genesys.com> wrote:
> Hi Hiroyuki,
>
>
> For both operations you'll have to provide partition key so "conflict" at DB
> level can always be resolved.
>
> But if two operations, LWT and non-LWT, are racing against each others the
> result is unpredictable, if non-LWT is applied after LWT the result will be
> overwritten.
>
>
> It seems mixing LWT and non-LWT can result in strange results, we recently
> opened a bug on non-working delete after LWT insert:
> https://issues.apache.org/jira/browse/CASSANDRA-14304
>
>
> Regards,
>
> JH
>
> ________________________________
> From: Hiroyuki Yamada <mo...@gmail.com>
> Sent: Saturday, March 24, 2018 4:38:15 AM
> To: user@cassandra.apache.org
> Subject: LWT on data mutated by non-LWT operation is valid ?
>
> Hi all,
>
> I have some question about LWT.
>
> I am wondering if LWT works only for data mutated by LWT or not.
> In other words, doing LWT on some data mutated by non-LWT operations
> is still valid ?
> I don't fully understand how system.paxos table works in LWT,
> but row_key should be empty for a data mutated by non-LWT operation,
> so conflict resolution seems impossible.
> It works only if a previous non-LWT operation is completely finished ?
>
> Thanks in advance.
>
> Best regards,
> Hiroyuki
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
> For additional commands, e-mail: user-help@cassandra.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
For additional commands, e-mail: user-help@cassandra.apache.org


Re: LWT on data mutated by non-LWT operation is valid ?

Posted by Jacques-Henri Berthemet <ja...@genesys.com>.
Hi Hiroyuki,


For both operations you'll have to provide partition key so "conflict" at DB level can always be resolved.

But if two operations, LWT and non-LWT, are racing against each others the result is unpredictable, if non-LWT is applied after LWT the result will be overwritten.


It seems mixing LWT and non-LWT can result in strange results, we recently opened a bug on non-working delete after LWT insert: https://issues.apache.org/jira/browse/CASSANDRA-14304


Regards,

JH

________________________________
From: Hiroyuki Yamada <mo...@gmail.com>
Sent: Saturday, March 24, 2018 4:38:15 AM
To: user@cassandra.apache.org
Subject: LWT on data mutated by non-LWT operation is valid ?

Hi all,

I have some question about LWT.

I am wondering if LWT works only for data mutated by LWT or not.
In other words, doing LWT on some data mutated by non-LWT operations
is still valid ?
I don't fully understand how system.paxos table works in LWT,
but row_key should be empty for a data mutated by non-LWT operation,
so conflict resolution seems impossible.
It works only if a previous non-LWT operation is completely finished ?

Thanks in advance.

Best regards,
Hiroyuki

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
For additional commands, e-mail: user-help@cassandra.apache.org