anchor.diff:      timer:apply_after(1000, ?MODULE, log_joined, []),
       {next_state, running, State}.
   
  +
  +joining(_Event, _From, State) ->
  +    {reply, unhandled, joining, State}.
  +
  +
   leaving({exit, _Pid}, LeaveData) ->
       error_logger:info_msg("ns_cluster: leaving cluster~n"),
       timer:sleep(1000),
  
positive.code:                      end, erlang:make_ref()).
  
  change_my_address(MyAddr) ->
      MyNode = node(),
      CookieBefore = erlang:get_cookie(),
      ns_server_sup:pull_plug(
        fun() ->
                case ns_mnesia:prepare_rename() of
                    ok ->
                        case dist_manager:adjust_my_address(MyAddr) of
                            nothing ->
                                ns_mnesia:backout_rename();
                            net_restarted ->
                                case erlang:get_cookie() of
                                    CookieBefore ->
                                        ok;
                                    CookieAfter ->
                                        error_logger:error_msg(
                                          "critical: Cookie has changed from ~p "
                                          "to ~p~n", [CookieBefore, CookieAfter]),
                                        exit(bad_cookie)
                                end,
                                ns_mnesia:rename_node(MyNode, node()),
                                rename_node(MyNode, node()),
                                ok
                        end;
                    E ->
                        ?log_error("Not attempting to rename node: ~p", [E])
                end
        end).
  
negative.code: -define(NODE_EJECTED, 4).
  
  %% States
  -export([running/2, running/3, joining/2, joining/3, leaving/2, leaving/3]).
  
  %% API
  -export([add_node/1, join/2, leave/0, leave/1, shun/1, log_joined/0]).
  