On Wed, 2009-04-08 at 11:02 +0200, Dietmar Maurer wrote:
> Hi all,
> 
> each node in my cluster has some data which should be available to all
> nodes. I also want to update that data in a consistent/atomic way:
> 
> 1.) acquire global lock
> 2.) read/update/write data
> 3.) release lock
> 

Virtual synchrony is tailor made for this problem.  Send messages via
CPG.  On delivery of the message, take some action to read update or
write the data to your internal data structures.  Do not do the
updating/reading/writing on the transmit of the message but only on
_delivery_.

This removes the need to have a lock entirely since the entire update
can be one atomic message and it will be ordered according to virtual
synchrony semantics.

Since every node sees every message in the same order there is never a
need for locks.  An example of why not is creation of a resource called
"datasetA".

3 nodes:
node A sends "create datasetA"
node B sends "create datasetA"
node C sends "create datasetA"

Only one of those nodes create dataset will arrive first.  The remainder
will arrive second and third.  Also, vs requires that each node sends in
the same order so it may be something like on all nodes:
B received, C received, A received.

In this case, B creates the dataset, C says "dataset exists" A says
"dataset exists".  All nodes see this same ordering.  The only reason to
use a lock service in practice is because there are not ordering
guarantees in the transmit medium of the system.

Hope that helps

Regards
-steve

> What the best way to implement that. For locking I can use the lock
> service. But what's the best/simplest way to distribute the node data to
> all members? I tried using CPG, but there I no synchronous message
> delivery available - which makes above read/update/write impossible?
> 

just do all updates/actions/etc on _delivery_ instead of transmit.

> Another option is using CKPT, but CKPT does not have any change
> notification? I need to combine that with CPG?
> 
> Maybe there is some example code around where I can see how to implement
> such system? Or some other documentation?
> 
> Many thank for your help,
> 
> - Dietmar
> 
>  
> 
> 
> 
> _______________________________________________
> Openais mailing list
> Openais@lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/openais

_______________________________________________
Openais mailing list
Openais@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to