Here is a draft FSA describing the code performing the consensus membership algorithm.
The states are in black circles,  the inputs are in red, and the actions are in blue.  The states are as follows:
 
S_ST Start/Stable state
S_BT Transition begun.  Someone noticed an apparent membership change.
S_TA Transition acknowledged.  Every node thought to be in the cluster has acknowledged the transition, (by sending a BT packet), or we've timed out waiting for them.
S_US Votes have been received, and we've been voted the transition leader.
S_THEM Votes have been received and another node was voted the transition leader.

Below is the list of inputs to the finite state machine:

I_BT Begin transition packet received, or transition event noted locally.
I_RQBMP Request for connectivity bitmap received.
I_LBT Last expected begin transition received, or timeout occurred.
I_TIME Timeout received
I_VOTE A vote was received from a node.  More votes still expected.
I_US Final I_VOTE received (or timeout occurred), and we were elected
I_THEM Final I_VOTE received (or timeout occurred) and another node was elected transition leader.
I_DONE Transition complete signal from leader.

The following are a list of actions the FSA takes:
 

A_BT Send begin transition packet
A_QBMR Queue a request for a bitmap
A_VOTE Vote on what node should be transition leader
A_RQBMP Declare self winner by requesting a connectivity bitmap.
A_DONE Send out cluster membership bitmap.

Normal Behavior Described

  1. When a membership event occurs, an I_BT input is generated, the A_BT action is taken and the FSA transitions to the BeginTransition (S_BT) State after a short delay.  The A_BT action consists of notifying cluster-aware applications that a transition is in progress, and sending out an A_BT packet containing your time in the cluster and the number of machines you can hear heartbeats from.
  2. After I_BT packets have been received from every machine currently in the cluster (or a timeout occurs), then an I_LBT input is generated indicating that the last input has been received.  At this point, a transition is made to the S_TA (transition acknowledged) is made.  The action A_VOTE is taken.  The A_VOTE action votes what machine it thinks ought to be the transition leader according to some sort of value function which tries to select what it thinks is a "good" leader.  This vote is cast along with the number of machines it received I_BT packets from.
  3. A_VOTE packets received in this state (S_TA) are tallied until the last one is received (this is missing from the FSA diagram).  When the last one is received (or a timeout occurs), either an I_US or an I_THEM input is generated.
  4. If an I_US input was received, then a transition is made to the S_US state, and the A_RQBMP action is taken.  The A_RQBMP action sends out a packet requesting a full connectivity bitmap from each node.  This I_RQBMP input is only sent out by the winner of the election.  As each bitmap packet is received (I_BMAP), it is recorded until the last one is received, in which case an I_LBMP input is generated instead.
  5. When the I_LBMP input is received in the S_US state, the action A_DONE is taken, and the transition is declared complete.
  6. On the other hand, if an I_THEM input was received, the transition is made to the S_THEM state.  Responses to queued bit map requests (if any) are handled at this time.
  7. When the transition leader sends an I_DONE message, then the transition is declared complete, and the state returns to S_ST.
  8. If a timeout (I_TIME) occurs before an I_DONE is received, then the transition is aborted by sending another I_BT transition packet to start the transition over again.