Shridhar Sahukar napsal(a): > Hi, > Hi > I trying to implement a service similar to CPG service for corosync and Just curios. Why are you doing that? Is there something you are missing in CPG? If so, can you please try to describe what is that? Because if that functionality is generally useful, we can consider implement it to CPG (or create new service). > need some help in understanding the sync callbacks. I tried to follow > the code as well as the way different services are implementing these > callbacks, but haven't got enough clarity. So could some one please > explain; > > - When does corosync invoke sync_init, sync_process, sync_activate, and > sync_abort callbacks for the services and what is the order of > invocation of these callbacks? > Corosync is basically state machine with following states: Operational, Gather, Recovery. Sync service more or less add new state, syncing (even from totem perspective, it's Operational state). When corosync membership changed (new processor appeared or some processor(s) disappeared), corosync starts gathering, then recovery and hopefully ends in operational state. Then, sync_init is called (with list of processors). It is usually used for saving membership. Right after that, sync_process is called. Sync_process can return -1, when it wishes to be called again, or 0 if not. Sync_process is protected by barrier, so until ALL messages sent in sync_init/sync_process are delivered to ALL nodes, it doesn't continue. When ALL messages from ALL processors for given services are delivered, sync_activate is called (this is correct place where to inform IPC clients about membership change). Last one is sync_abort. This is called when new node appeared or some node(s) disappeared during sync_process. If that happen, whole sync process repeats (so sync_init is called, then sync_process, ...). It's also very important to note, that whole process is executed for every service in order on all nodes and each service is protected by barrier. I hope it helps. Regards, Honza > Regards, > Shridhar > _______________________________________________ > discuss mailing list > discuss@xxxxxxxxxxxx > http://lists.corosync.org/mailman/listinfo/discuss _______________________________________________ discuss mailing list discuss@xxxxxxxxxxxx http://lists.corosync.org/mailman/listinfo/discuss