anchor.diff:                                 keep_nodes=KeepNodes,
                                  eject_nodes=EjectNodes,
                                  failed_nodes=FailedNodes,
  -                               stop_timer=MaybeTref,
  -                               type=Type}) ->
  +                               type=Type} = State) ->
  +    cancel_stop_timer(State),
       Status = case Reason of
                    graceful_failover_done ->
                        none;
  
positive.code:                      ?user_log(?REBALANCE_STOPPED,
                                 "Rebalance stopped by user.~n"),
                       ns_cluster:counter_inc(rebalance_stop),
                       case MaybeTref of
                           undefined ->
                               ok;
                           _ ->
                               gen_fsm:cancel_timer(MaybeTref)
                       end,
                       none;
                   _ ->
                       ?user_log(?REBALANCE_FAILED,
  
negative.code:                    {rebalance_status_uuid, couch_uuids:random()},
                     {rebalancer_pid, GracefulPid},
                     {graceful_failover_pid, RebalancerPid}]).
  
  cancel_stop_timer(State) ->
      do_cancel_stop_timer(State#rebalancing_state.stop_timer).
  
  do_cancel_stop_timer(undefined) ->
      ok;
  do_cancel_stop_timer(TRef) when is_reference(TRef) ->
      gen_fsm:cancel_timer(TRef).
  