[infinispan-dev] An observation about total order and consistency
Paolo Romano
romano at inesc-id.pt
Wed Mar 7 08:16:55 EST 2012
Hi Mircea,
if I recall correctly currently (with 2PC) the commit is sent
asynchronously (without waiting to gather acks). If this is correct,
then the transaction originator can return from a commit on a
transaction T before other nodes have actually applied T's updates.
Therefore, the second assert:
assert cache(1).get(k).equals(v); //might fail!
may fail as well using 2PC. Or am I missing something?
Cheers,
Paolo
On 3/7/12 1:44 AM, Mircea Markus wrote:
> With total order and sync replication it is possible for the following:
>
> tm.begin()
> cache(0).put(k,v);
> tm.commit();
>
> assert cache(0).get(k).equals(v); //always passes
> assert cache(1).get(k).equals(v); //might fail!
> //..but
> eventually(cache(1).get(k).equals(v)) //this will always pass
>
> In other words, after a transaction is completed, you are only guaranteed to see its results on the originator node. On replicas the value is only eventually made available.
> Whilst this is fine for embedded caches, as in practice the replication would happen between different JVMs, this is still relevant for:
> - hotrod: a client might tx-write on a node and read from the other
> - tests
>
> Cheers
> Mircea
> --
> Mircea Markus
> twitter.com/mirceamarkus
>
> Sr. Software Engineer, Infinispan
> http://www.infinispan.org
>
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev
More information about the infinispan-dev
mailing list