Re: new question ;-) // RE: understanding batch atomicity

2017-09-29 Thread DuyHai Doan
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  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.dev...@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:doanduy...@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.dev...@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
>
>
>


Re: new question ;-) // RE: understanding batch atomicity

2017-09-29 Thread Jon Haddad
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 
>  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:doanduy...@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 
> > 
> 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



Re: new question ;-) // RE: understanding batch atomicity

2017-09-29 Thread daemeon reiydelle
recall that a delete is actually a corner case of an update, as is an
insert.

As I read the snippet, you are updating multiple tables. The partition key
is table specific, so two sets of update batches are handled here.

We like to say that we don’t get to choose our parents, that they were
given by chance – yet, we can truly choose whose children we wish to be. -
Seneca the Younger



*Daemeon C.M. ReiydelleSan Francisco 1.415.501.0198London 44 020 8144 9872*


On Fri, Sep 29, 2017 at 8:59 AM, DE VITO Dominique <
dominique.dev...@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:doanduy...@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.dev...@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
>
>
>
>
>


new question ;-) // RE: understanding batch atomicity

2017-09-29 Thread DE VITO Dominique
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:doanduy...@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 
> 
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