[infinispan-dev] tx optimizations

Manik Surtani manik at jboss.org
Mon Apr 6 05:29:46 EDT 2009


On 3 Apr 2009, at 20:33, Mircea Markus wrote:

> Hi,
>
> Here are two optimizations that can be implemented in our 2PC model:
> 1) if there are only two members int the cluster use an 1PC (or if  
> you only replicate to one buddy, like in buddy replication). If the  
> 1st phase fails remotely, then also rollback locally. This would  
> reduce one network roundtrip.

Interesting.  I assume with BR you mean DIST where a key is mapped on  
to 1 other peer - Infinispan won't support BR as in JBC.  ;-)

While this is an interesting thought, it does raise the potential for  
race conditions - since this decision will have to be taken in the  
TxInterceptor in the beforeCompletion phase of a transaction, and by  
the time the call gets to the interceptor for replication, the  
topology may have changed such that you need to replicate to 2 instead  
of 1 other peer.  Which would mean a 2PC again.  So it does need some  
thought.

> 2) when asked to prepare, a participant might return a value  
> indicating that no changes were made (read-only participant), so  
> this one won't need an commit message, so less roundtrip.

No, prepares only contain modifications.   Read commands don't get  
added to a prepare, and if a prepare doesn't contain any writes, it  
isn't broadcast economising on the network call.

>
> Wdyt?
>
> Cheers,
> Mircea
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Manik Surtani
Lead, JBoss Cache
http://www.jbosscache.org
manik at jboss.org




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/infinispan-dev/attachments/20090406/7a518ec7/attachment-0001.html 


More information about the infinispan-dev mailing list