anchor.diff: -%% @doc The coordinator for a given Clock SI transaction.  
  -%%		It handles the state of the tx and sends each operation
  +%%@doc	The coordinator for a given Clock SI transaction.  
  +%%		It handles the state of the tx and executes the operations sequentially by
  +%%		sending each operation
   %%		to the responsible clockSI_vnode of the involved key.
   %%		when a tx is finalized (committed or aborted, the fsm
   %%		also finishes.
   
  -
  -
   -module(clockSI_tx_coord_fsm).
   -behavior(gen_fsm).
   -include("floppy.hrl").
  
positive.code: 		{next_state, receive_committed, S0#state{num_to_ack= NumToAck-1}}
      end.
      
      %% Should we retry sending the committed message if we don't receive a reply from
      %% every partition?
      %% What delivery guarantees does sending messages provide?
      
  
  	
  	
  
  	
  	
  	
      
  
  
  
  handle_info(_Info, _StateName, StateData) ->
      {stop,badmsg,StateData}.
  
negative.code:          io:format("ClockSI: Keep collecting prepare replies~n"),
  	{next_state, receive_prepared, S0#state{num_to_ack= NumToAck-1}, Transaction#tx{prepare_time=PrepareTime}}
      end;
  receive_prepared({_Node, abort}, S0) ->
  	{next_state, abort, S0};   
  receive_prepared(timeout, S0) ->
  	{next_state, abort, S0}.
  
  %%	after receiving all prepare_times, send the commit message to all updated partitions,
  %% 	and go to the "receive_committed" state.
  committing(timeout, SD0=#state{transaction=Transaction, updated_partitions=UpdatedPartitions}) -> 
  	clock_SI_vnode:commit(UpdatedPartitions, Transaction),
  	NumToAck=lists:lenght(UpdatedPartitions),
  	{next_state, receive_committed, SD0#state{num_to_ack=NumToAck, transaction=#tx{state=committed}}, 0}.
  	
  %%	the fsm waits for acks indicating that each partition has successfully committed the tx
  %%	and finishes operation.
  %% Should we retry sending the committed message if we don't receive a reply from
  %% every partition?
  %% What delivery guarantees does sending messages provide?
  receive_committed({_Node}, S0=#state{num_to_ack= NumToAck}) ->
      case NumToAck of 1 -> 
      	io:format("ClockSI: Finished collecting commit acks. Tx committed succesfully."),
  