On Tue, 2009-04-14 at 14:05 +0200, Dietmar Maurer wrote:
> So CPG provide a framework to implement distributed finite state
> machines (DFSM). But there is no standard way to get the initial state
> of the DFSM. Almost all applications need to get the initial state, so I
> wonder if it would make sense to provide a service which solves that
> problem (at least as a example).
> 
> My current solution is:
> 
>   I introduce a CPG mode, which is either:
> 
>   DFSM_MODE_SYNC ... CPG is syncing state. only state synchronization
>                      messages allowed. Other messages are
> delayed/queued.
> 
>   DFSM_MODE_WORK ... STATE is synced accross all members - normal
> operation. Queued
>                      messages are delivered when we reach this state.
> 
>   When a new node joins, CPG immediately change mode to
>   DFSM_MODE_SYNC. Then all members send their state.
> 
>   When a node received the states of all members, it computes the new
>   state by merging all received states (dfsm_state_merge_fn), and
>   finally switches mode to DFSM_MODE_WORK.
> 
> Does that make sense?
> 

Cool idea if it wasn't totally integrated with CPG but instead some
external service which people could use in addition to CPG.

It would make a great addition as a service engine or c library using
CPG.

Regards
-steve


> - Dietmar
> 
> 
> > On Thu, Apr 09, 2009 at 09:00:08PM +0200, Dietmar Maurer wrote:
> > > > If new, normal read/write messages to the replicated state
> continue
> > while
> > > > the new node is syncing the pre-existing state, the new node needs
> > to save
> > > > those operations to apply after it's synced.
> > >
> > > Ah, that probably works. But can lead to very high memory usage if
> > traffic
> > > is high.
> > 
> > If that's a problem you could block normal activity during the sync
> > period.
> > 
> > > Is somebody really using that? If so, is there some code available
> > > (for safe/replay)?
> > 
> > There is no general purpose code.  dlm_controld is an example of a
> > program
> > doing something like this, http://git.fedorahosted.org/git/dlm.git
> > 
> > It uses cpg to replicate state of posix locks, uses checkpoints to
> sync
> > existing lock state to new nodes, and saves messages on a new node
> > until it
> > has completed syncing (i.e. reading pre-existing state from the
> > checkpoint.)
> > 
> > Dave
> 
> 

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

Reply via email to