anchor.diff:  
   handle_cast(leave, State) ->
       ?cluster_log(0001, "Node ~p is leaving cluster.", [node()]),
  +
  +    ok = file:write_file(leave_marker_path(), <<"">>),
   
       %% first thing we do is stopping nearly everything
       ok = ns_server_cluster_sup:stop_cluster(),
  
positive.code: 
      ?cluster_debug("Leaving cluster", []),
      timer:sleep(1000),
      {ok, _} = ns_server_cluster_sup:start_cluster(),
      ns_ports_setup:restart_memcached(),
      {noreply, State}.
  
negative.code:     %%
      %% So reset_address() below drops node's manually assigned
      %% hostname if any and assigns 127.0.0.1 marking it as automatic.
      net_restarted = dist_manager:reset_address(),
      %% and then we clear config. In fact better name would be 'reset',
      %% because as seen above we actually re-initialize default config
      ns_config:clear([directory]),
  