On Wednesday 29 September 2004 19:07, Lars Ellenberg wrote: > / 2004-09-29 14:58:47 +0200 > > \ Philipp Reisner: > > > [...] > > > > > > > Currently this covers only the states, and outlines the > > > > transitions. It should help to define the actions to be taken on > > > > every possible "input" to the DRBD internal "state machine". > > > > > > While reading through this giant e-mail I lost my confidence that it > > > could be a good idea to have a "central" state switching function in > > > DRBD, but of course I will see what this discussions gives... > > > > Thought about this a bit more... and came to the conclusion that it > > would be a good idea. What do you think of this skeleton - > > pseude code (it compiles actually). > > I think it probably should come out more like a real state machine, > with a defined set of possible INPUTS, > a defined set of states (which should not have the same detail depth as > the actual drbd internal state set with all its different attributes), > a set of actions, and a defined state[INPUT] => action => newstate > matrix. > > maybe that is overkill. Currently I want to go the way that was outlined with the new_st.c skeleton. Regarding: only worker should do state changes. We have quite a lot of inputs that are asynchronous by their nature. E.g. Disk fails. It does not make any sense to synchronize an advance in the disk-state state-machine with anything. While it makes a lot of sense to synchronize changes to the node state machine. At first I drew a directed graph of the cstates we have in drbd-0.7 (see cstates-7.ps) You will immediately realize that the differentiation between Unconfigured and StandAllone is a leftover from drbd-0.6 Then I drew directed graphs of the "state machines" as I see them for drbd-0.8 conn-states-8.ps, disk-states-8.ps, node-states-8.ps (has 2 pages) PS: The program is graphviz -Philipp -- : Dipl-Ing Philipp Reisner Tel +43-1-8178292-50 : : LINBIT Information Technologies GmbH Fax +43-1-8178292-82 : : Schönbrunnerstr 244, 1120 Vienna, Austria http://www.linbit.com :