anchor.diff:      erlang:process_flag(priority, high),
       self() ! acquire_initial_status,
       ns_pubsub:subscribe_link(ns_config_events,
  -                             fun handle_config_event/2, {undefined, undefined}),
  +                             fun handle_config_event/2,
  +                             #cfg_handler_state{}),
       case misc:get_env_default(dont_log_stats, false) of
           false ->
               timer2:send_interval(?LOG_INTERVAL, log);
  
positive.code: handle_recovery_status_change(New, undefined) ->
      {New, true}.
  
  handle_config_event({rebalance_status_uuid, NewValue}, {RebalanceState, RecoveryState}) ->
      case NewValue of
          RebalanceState ->
              ok;
          _ ->
              ns_doctor ! significant_change
      end,
      {NewValue, RecoveryState};
  handle_config_event({recovery_status, NewValue}, {RebalanceState, RecoveryState}) ->
      {NewState, Changed} = handle_recovery_status_change(NewValue, RecoveryState),
      case Changed of
          true ->
              ns_doctor ! significant_change;
          false ->
              ok
      end,
      {RebalanceState, NewState};
  handle_config_event({nodes_wanted, _} = Msg, State) ->
      ns_doctor ! Msg,
      State;
  
negative.code:           tasks_version :: undefined | string()
           }).
  
  -record(cfg_handler_state, {
            rebalance_state,
            recovery_state
           }).
  
  -define(doctor_debug(Msg), ale:debug(?NS_DOCTOR_LOGGER, Msg)).
  -define(doctor_debug(Fmt, Args), ale:debug(?NS_DOCTOR_LOGGER, Fmt, Args)).
  
  