anchor.diff:                                         Result2 == ok ->
                                              {{ok, done}, TransLog2};
                                          true ->
  -                                           {{fail, notfound}, TransLog2}
  +                                           {{fail, write}, TransLog2}
                                      end;
                                  true ->
                                      {{fail, {key_changed, ReadValue}}, TransLog1}
  
positive.code:     end.
  
  %% @doc reads the value of a key
  %% @spec read(key()) -> {failure, term()} | value()
  read(Key) ->
      case util:tc(transaction_api, quorum_read, [Key]) of
          {_Time, {fail, Reason}} ->
  
negative.code:     transaction_api:delete(Key, 2000).
  
  %% @doc atomic compare and swap
  %% @spec test_and_set(key(), value(), value()) -> ok | {fail, term()}
  -spec test_and_set(key(), value(), value()) -> ok | {fail, Reason::term()}.
  test_and_set(Key, OldValue, NewValue) ->
      TFun = fun(TransLog) ->
                     {Result, TransLog1} = transaction_api:read(Key, TransLog),
  