anchor.diff:  
               notify_janitor_finished(JanitorRequests, rebalance_running),
               ns_cluster:counter_inc(rebalance_start),
  -            ns_config:set([{rebalance_status, running},
  -                           {rebalance_status_uuid, couch_uuids:random()},
  -                           {graceful_failover_pid, undefined},
  -                           {rebalancer_pid, Pid}]),
  +
  +            Type = rebalance,
  +            set_rebalance_status(Type, running, Pid),
   
               {reply, ok, rebalancing,
                #rebalancing_state{rebalancer=Pid,
  
positive.code:                         keep_nodes=ns_node_disco:nodes_wanted(),
                          eject_nodes=[],
                          failed_nodes=[],
                          type=move_vbuckets}};
  idle(stop_rebalance, _From, State) ->
      ns_janitor:stop_rebalance_status(
        fun () ->
  
negative.code:                                                                    ephemeral)],
      Buckets = MembaseBuckets ++ EphemeralBuckets,
      [services | Buckets].
  
  set_rebalance_status(_Type, Status, undefined) ->
      do_set_rebalance_status(Status, undefined, undefined);
  set_rebalance_status(rebalance, Status, Pid) when is_pid(Pid) ->
      do_set_rebalance_status(Status, Pid, undefined);
  set_rebalance_status(graceful_failover, Status, Pid) when is_pid(Pid) ->
      do_set_rebalance_status(Status, Pid, Pid);
  set_rebalance_status(move_vbuckets, Status, Pid) ->
      set_rebalance_status(rebalance, Status, Pid).
  
  do_set_rebalance_status(Status, RebalancerPid, GracefulPid) ->
      ns_config:set([{rebalance_status, Status},
                     {rebalance_status_uuid, couch_uuids:random()},
                     {rebalancer_pid, GracefulPid},
                     {graceful_failover_pid, RebalancerPid}]).
  