anchor.diff:          ns_config:set_initial(nodes_wanted, [node(), RemoteNode]),
           error_logger:info_msg("pre-join cleaned config is:~n~p~n",
                                 [ns_config:get()]),
  -        mb_mnesia:prepare_join(),
           true = erlang:set_cookie(node(), NewCookie),
           %% Let's verify connectivity.
           Connected = net_kernel:connect_node(RemoteNode),
  
positive.code:     case RemoteNode == node() of
          false ->
              ?log_info("Shunning ~p", [RemoteNode]),
              try mb_mnesia:demote(RemoteNode)
              catch E:R ->
                      ?log_info("Failed to demote ~p: ~p", [RemoteNode, {E, R}])
              end,
              ns_config:update_key(nodes_wanted,
                                   fun (X) ->
                                           X -- [RemoteNode]
  
negative.code:               end,
      case Status2 of
          {ok, _} ->
              ns_log:log(?MODULE, ?NODE_JOINED, "Node ~s joined cluster",
                         [node()]),
              Status2;
          _ ->
              ?log_error("Failed to join cluster because of: ~p~n", [Status2]),
              Status2
  