anchor.diff:                                 {"bucket2", [{servers, [a, b, c]}]}])),
       ok.
   
  -%% @doc Save the current state in ns_config
  --spec make_state_persistent(State::#state{}) -> ok.
  -make_state_persistent(State) ->
  -    Enabled = case State#state.tick_ref of
  -        nil -> false;
  -        _ -> true
  -    end,
  -    ns_config:set(auto_failover_cfg,
  -                  [{enabled, Enabled},
  -                   {timeout, State#state.timeout},
  -                   {count, State#state.count}]).
  +-define(FLAG, #state.reported_autofailover_unsafe).
  +reported_test() ->
  +    %% nothing reported initially
  +    State = init_reported(#state{}),
  +
  +    %% we correctly instructed to report the condition for the first time
  +    ?assertEqual(should_report(?FLAG, State), true),
  +    State1 = note_reported(?FLAG, State),
  +    State2 = update_reported_flags_by_actions([{failover, some_node}], State1),
  +
  +    %% we don't report it second time
  +    ?assertEqual(should_report(?FLAG, State2), false),
  +
  +    %% we report the condition again for the other "instance" of failover
  +    %% (i.e. failover is not needed for some time, but the it's needed again)
  +    State3 = update_reported_flags_by_actions([], State2),
  +    ?assertEqual(should_report(?FLAG, State3), true),
  +
  +    %% we report the condition after we explicitly drop it (note that we use
  +    %% State2)
  +    State4 = init_reported(State2),
  +    ?assertEqual(should_report(?FLAG, State4), true),
  +
  +    ok.
  +
  +-endif.
  
positive.code:           % Time a node needs to be down until it is automatically failovered
            timeout=nil :: nil | integer(),
            % Counts the number of nodes that were already auto-failovered
            count=0 :: non_neg_integer()
           }).
  
  %%
  
negative.code:                       true
                end
        end, NonPendingNodes).
  
  %% @doc Save the current state in ns_config
  -spec make_state_persistent(State::#state{}) -> ok.
  make_state_persistent(State) ->
      Enabled = case State#state.tick_ref of
          nil -> false;
          _ -> true
      end,
      ns_config:set(auto_failover_cfg,
                    [{enabled, Enabled},
                     {timeout, State#state.timeout},
                     {count, State#state.count}]).
  
  note_reported(Flag, State) ->
      false = element(Flag, State),
      setelement(Flag, State, true).
  
  should_report(Flag, State) ->
      not(element(Flag, State)).
  
  init_reported(State) ->
      State#state{reported_autofailover_unsafe=false}.
  
  update_reported_flags_by_actions(Actions, State) ->
      case lists:keymember(failover, 1, Actions) of
          false ->
              init_reported(State);
          true ->
              State
      end.
  
  
  -ifdef(EUNIT).
  
  actual_down_nodes_inner_test() ->
      PList0 = [{a, ["bucket1", "bucket2"]},
  