[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cassandra-user
Subject:    Re: new question ;-) // RE: understanding batch atomicity
From:       DuyHai Doan <doanduyhai () gmail ! com>
Date:       2017-09-29 16:13:16
Message-ID: CABNXB2DYLrCmiC6gqm5DO+f_-end3LQ80C_w9COz5B1j4XaZtw () mail ! gmail ! com
[Download RAW message or body]

We should probably replace "atomic" by "automatic retry" because it
reflects exactly the actual guarantees

On Fri, Sep 29, 2017 at 6:10 PM, Jon Haddad <jon@jonhaddad.com> wrote:

> The use of "atomic" for batches is misleading.  Batches will eventually
> complete, that doesn't make them atomic.  "All or nothing" is also
> incorrect, as you can read them in the middle and get "some parts of it",
> and without a rollback it's just "eventually all".
>
>
> On Sep 29, 2017, at 10:59 AM, DE VITO Dominique <
> dominique.devito@thalesgroup.com> wrote:
>
> Thanks DuyHai !
>
> Does anyone know if BATCH provides atomicity for all mutations of a given
> partition key for a __single__ table ?
>
> Or if BATCH provides atomicity for all mutations of a given partition key
> for __ALL__ mutated tables into the BATCH ?
>
> That is, in case of :
>
> BEGIN BATCH
> Update table_1 where PartitionKey_table_1 = 1 …             => (A) mutation
> Update table_2 where PartitionKey_table_2 = 1 …             => (B) mutation
> END BATCH
>
> Here, both mutations occur for the same PartitionKey = 1
> => are mutations (A) & (B) done in an atomic way (all or nothing) ?
>
> Thanks.
>
> Dominique
>
>
>
> [@@ THALES GROUP INTERNAL @@]
>
> *De :* DuyHai Doan [mailto:doanduyhai@gmail.com <doanduyhai@gmail.com>]
> *Envoyé :* vendredi 29 septembre 2017 17:10
> *À :* user
> *Objet :* Re: understanding batch atomicity
>
> All updates here means all mutations == INSERT/UPDATE or DELETE
>
>
>
> On Fri, Sep 29, 2017 at 5:07 PM, DE VITO Dominique <
> dominique.devito@thalesgroup.com> wrote:
> Hi,
>
> About BATCH, the Apache doc https://cassandra.apache.
> org/doc/latest/cql/dml.html?highlight=atomicity says :
>
> "*The BATCH statement group multiple modification statements
> (insertions/updates and deletions) into a single statement. It serves
> several purposes:*
> *...*
> *All updates in a BATCH belonging to a given partition key are performed
> in isolation*"
>
> Is "All *updates*" meaning equivalent to "All modifications (whatever
> it's sources: INSERT or UPDATE statements)" ?
>
> Or, is "*updates*" meaning partition-level isolation *only* for UPDATE
> statements into the batch (w/o taking into isolation the INSERT other
> statements into the batch) ?
>
> Thanks
>
> Regards
> Dominique
>
>
>

[Attachment #3 (text/html)]

<div dir="ltr">We should probably replace &quot;atomic&quot; by &quot;automatic \
retry&quot; because it reflects exactly the actual guarantees</div><div \
class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 29, 2017 at 6:10 PM, Jon \
Haddad <span dir="ltr">&lt;<a href="mailto:jon@jonhaddad.com" \
target="_blank">jon@jonhaddad.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div style="word-wrap:break-word"><div>The use of "atomic" \
for batches is misleading.   Batches will eventually complete, that doesn't make them \
atomic.   "All or nothing" is also incorrect, as you can read them in the middle and \
get "some parts of it", and without a rollback it's just "eventually \
all".</div><div><div class="h5"><div><br></div><br><div><blockquote \
type="cite"><div>On Sep 29, 2017, at 10:59 AM, DE VITO Dominique &lt;<a \
href="mailto:dominique.devito@thalesgroup.com" \
target="_blank">dominique.devito@thalesgroup.<wbr>com</a>&gt; wrote:</div><br \
class="m_-5090903081079652467Apple-interchange-newline"><div><div \
class="m_-5090903081079652467WordSection1" \
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal \
;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div \
style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:&#39;Times New \
Roman&#39;,serif"><span lang="EN-US" \
style="font-size:11pt;font-family:Arial,sans-serif;color:rgb(31,73,125)">Thanks \
DuyHai  !<u></u><u></u></span></div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span \
lang="EN-US" style="font-size:11pt;font-family:Arial,sans-serif;color:rgb(31,73,125)"><u></u> \
<u></u></span></div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span \
lang="EN-US" style="font-size:11pt;font-family:Arial,sans-serif;color:rgb(31,73,125)">Does \
anyone know if BATCH provides atomicity for all mutations of a given partition key \
for a __single__ table ?<span class="m_-5090903081079652467Apple-converted-space">  \
</span><u></u><u></u></span></div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span \
lang="EN-US" style="font-size:11pt;font-family:Arial,sans-serif;color:rgb(31,73,125)"><u></u> \
<u></u></span></div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span \
lang="EN-US" style="font-size:11pt;font-family:Arial,sans-serif;color:rgb(31,73,125)">Or \
if BATCH provides atomicity for all mutations of a given partition key for __ALL__ \
mutated tables into the BATCH ?<u></u><u></u></span></div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span \
lang="EN-US" style="font-size:11pt;font-family:Arial,sans-serif;color:rgb(31,73,125)"><u></u> \
<u></u></span></div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span \
lang="EN-US" style="font-size:11pt;font-family:Arial,sans-serif;color:rgb(31,73,125)">That \
is, in case of :<u></u><u></u></span></div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span \
lang="EN-US" style="font-size:11pt;font-family:Arial,sans-serif;color:rgb(31,73,125)"><u></u> \
<u></u></span></div><div style="margin:0cm 0cm 0.0001pt \
18pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span lang="EN-US" \
style="font-size:11pt;font-family:Arial,sans-serif;color:rgb(31,73,125)">BEGIN \
BATCH<span class="m_-5090903081079652467Apple-converted-space">  \
</span><u></u><u></u></span></div><div style="margin:0cm 0cm 0.0001pt \
35.4pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span lang="EN-US" \
style="font-size:11pt;font-family:Arial,sans-serif;color:rgb(31,73,125)">Update \
table_1 where PartitionKey_table_1 = 1 …                         =&gt; (A) \
mutation<u></u><u></u></span></div><div style="margin:0cm 0cm 0.0001pt \
35.4pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span lang="EN-US" \
style="font-size:11pt;font-family:Arial,sans-serif;color:rgb(31,73,125)">Update \
table_2 where PartitionKey_table_2 = 1 …                         =&gt; (B) \
mutation<u></u><u></u></span></div><div style="margin:0cm 0cm 0.0001pt \
18pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span lang="EN-US" \
style="font-size:11pt;font-family:Arial,sans-serif;color:rgb(31,73,125)">END \
BATCH<u></u><u></u></span></div><div style="margin:0cm 0cm 0.0001pt \
36pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span lang="EN-US" \
style="font-size:11pt;font-family:Arial,sans-serif;color:rgb(31,73,125)"><u></u>  \
<u></u></span></div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span \
lang="EN-US" style="font-size:11pt;font-family:Arial,sans-serif;color:rgb(31,73,125)">Here, \
both mutations occur for the same PartitionKey = 1<u></u><u></u></span></div><div \
style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:&#39;Times New \
Roman&#39;,serif"><span lang="EN-US" \
style="font-size:11pt;font-family:Arial,sans-serif;color:rgb(31,73,125)">=&gt; are \
mutations (A) &amp; (B) done in an atomic way (all or nothing) \
?<u></u><u></u></span></div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span \
lang="EN-US" style="font-size:11pt;font-family:Arial,sans-serif;color:rgb(31,73,125)"><u></u> \
<u></u></span></div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span \
lang="EN-US" style="font-size:11pt;font-family:Arial,sans-serif;color:rgb(31,73,125)">Thanks.<u></u><u></u></span></div><div \
style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:&#39;Times New \
Roman&#39;,serif"><span lang="EN-US" \
style="font-size:11pt;font-family:Arial,sans-serif;color:rgb(31,73,125)"><u></u>  \
<u></u></span></div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span \
lang="EN-US" style="font-size:11pt;font-family:Arial,sans-serif;color:rgb(31,73,125)">Dominique<u></u><u></u></span></div><div \
style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:&#39;Times New \
Roman&#39;,serif"><span \
style="font-size:11pt;font-family:Arial,sans-serif;color:rgb(31,73,125)"><u></u>  \
<u></u></span></div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span \
style="font-size:11pt;font-family:Arial,sans-serif;color:rgb(31,73,125)"><u></u>  \
<u></u></span></div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span \
style="font-size:11pt;font-family:Arial,sans-serif;color:rgb(31,73,125)"><u></u>  \
<u></u></span></div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span \
style="font-size:11pt;font-family:Arial,sans-serif;color:rgb(31,73,125)">[@@ THALES \
GROUP INTERNAL @@]<u></u><u></u></span></div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><u></u>  \
<u></u></div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><b><span \
style="font-size:10pt;font-family:Tahoma,sans-serif">De  :</span></b><span \
style="font-size:10pt;font-family:Tahoma,sans-serif"><span \
class="m_-5090903081079652467Apple-converted-space">  </span>DuyHai Doan [<a \
href="mailto:doanduyhai@gmail.com" style="color:purple;text-decoration:underline" \
target="_blank">mailto:doanduyhai@gmail.com</a>]<span \
class="m_-5090903081079652467Apple-converted-space">  </span><br><b>Envoyé  \
:</b><span class="m_-5090903081079652467Apple-converted-space">  </span>vendredi 29 \
septembre 2017 17:10<br><b>À  :</b><span \
class="m_-5090903081079652467Apple-converted-space">  </span>user<br><b>Objet  \
:</b><span class="m_-5090903081079652467Apple-converted-space">  </span>Re: \
understanding batch atomicity<u></u><u></u></span></div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><u></u>  \
<u></u></div><div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif">All updates here \
means all mutations == INSERT/UPDATE or DELETE<u></u><u></u></div><div><div \
style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:&#39;Times New \
Roman&#39;,serif"><u></u>  <u></u></div></div><div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><u></u>  \
<u></u></div></div></div><div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><u></u>  \
<u></u></div><div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif">On Fri, Sep 29, \
2017 at 5:07 PM, DE VITO Dominique &lt;<a \
href="mailto:dominique.devito@thalesgroup.com" \
style="color:purple;text-decoration:underline" \
target="_blank">dominique.devito@thalesgroup.<wbr>com</a>&gt; \
wrote:<u></u><u></u></div><div><div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span \
lang="EN-US" style="font-family:Arial,sans-serif">Hi,</span><u></u><u></u></div><div \
style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:&#39;Times New \
Roman&#39;,serif"><span lang="EN-US" style="font-family:Arial,sans-serif">  \
</span><u></u><u></u></div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span \
lang="EN-US" style="font-family:Arial,sans-serif">About BATCH, the Apache doc<span \
class="m_-5090903081079652467Apple-converted-space">  </span></span><a \
href="https://cassandra.apache.org/doc/latest/cql/dml.html?highlight=atomicity" \
style="color:purple;text-decoration:underline" target="_blank"><span \
lang="EN-US">https://cassandra.apache.<wbr>org/doc/latest/cql/dml.html?<wbr>highlight=atomicity</span></a><span \
style="font-family:Arial,sans-serif"><span \
class="m_-5090903081079652467Apple-converted-space">  </span></span><span \
lang="EN-US" style="font-family:Arial,sans-serif">says  \
:</span><u></u><u></u></div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span \
lang="EN-US" style="font-family:Arial,sans-serif">  </span><u></u><u></u></div><div \
style="margin:0cm 0cm 0.0001pt 35.4pt;font-size:12pt;font-family:&#39;Times New \
Roman&#39;,serif"><span lang="EN-US" style="font-family:Arial,sans-serif">"<i>The \
BATCH statement group multiple modification statements (insertions/updates and \
deletions) into a single statement. It serves several \
purposes:</i></span><u></u><u></u></div><div style="margin:0cm 0cm 0.0001pt \
35.4pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><i><span \
lang="EN-US" style="font-family:Arial,sans-serif">...</span></i><u></u><u></u></div><div \
style="margin:0cm 0cm 0.0001pt 35.4pt;font-size:12pt;font-family:&#39;Times New \
Roman&#39;,serif"><i><span lang="EN-US" style="font-family:Arial,sans-serif">All \
updates in a BATCH belonging to a given partition key are performed in \
isolation</span></i><span lang="EN-US" \
style="font-family:Arial,sans-serif">"</span><u></u><u></u></div><div \
style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:&#39;Times New \
Roman&#39;,serif"><span lang="EN-US" style="font-family:Arial,sans-serif">  \
</span><u></u><u></u></div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span \
lang="EN-US" style="font-family:Arial,sans-serif">Is "All<span \
class="m_-5090903081079652467Apple-converted-space">  </span><i>updates</i>" meaning \
equivalent to "All modifications (whatever it's sources: INSERT or UPDATE \
statements)" ?</span><u></u><u></u></div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span \
lang="EN-US" style="font-family:Arial,sans-serif">  </span><u></u><u></u></div><div \
style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:&#39;Times New \
Roman&#39;,serif"><span lang="EN-US" style="font-family:Arial,sans-serif">Or, is \
"<i>updates</i>" meaning partition-level isolation<span \
class="m_-5090903081079652467Apple-converted-space">  </span><i>only</i><span \
class="m_-5090903081079652467Apple-converted-space">  </span>for UPDATE statements \
into the batch (w/o taking into isolation the INSERT other statements into the batch) \
?</span><u></u><u></u></div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span \
lang="EN-US" style="font-family:Arial,sans-serif">  </span><u></u><u></u></div><div \
style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:&#39;Times New \
Roman&#39;,serif"><span lang="EN-US" \
style="font-family:Arial,sans-serif">Thanks</span><u></u><u></u></div><div \
style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:&#39;Times New \
Roman&#39;,serif"><span lang="EN-US" style="font-family:Arial,sans-serif">  \
</span><u></u><u></u></div><div style="margin:0cm 0cm \
0.0001pt;font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"><span \
style="font-family:Arial,sans-serif">Regards</span><u></u><u></u></div><div \
style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:&#39;Times New \
Roman&#39;,serif"><span \
style="font-family:Arial,sans-serif;color:rgb(136,136,136)">Dominique</span></div></di \
v></div></div></div></div></div></blockquote></div><br></div></div></div></blockquote></div><br></div>




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic