diff options
| author | Tim Watson <tim@rabbitmq.com> | 2012-09-24 12:17:23 +0100 |
|---|---|---|
| committer | Tim Watson <tim@rabbitmq.com> | 2012-09-24 12:17:23 +0100 |
| commit | b8d5a0ca8a62dcd14062821faedf2ec3a0cec216 (patch) | |
| tree | 7da5192ebb2d876a93b858aae75667a082ad71a4 /src/rabbit.erl | |
| parent | 61f0808ed9470cad6146c694e8431b5f19825360 (diff) | |
| parent | 70de5d805e9165a80c570d0edab52b203189a5a6 (diff) | |
| download | rabbitmq-server-git-b8d5a0ca8a62dcd14062821faedf2ec3a0cec216.tar.gz | |
merge default into bug25148
Diffstat (limited to 'src/rabbit.erl')
| -rw-r--r-- | src/rabbit.erl | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index 6fa1a12aa7..e958784197 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -176,7 +176,7 @@ -rabbit_boot_step({notify_cluster, [{description, "notify cluster nodes"}, - {mfa, {rabbit_node_monitor, notify_cluster, []}}, + {mfa, {rabbit_node_monitor, notify_node_up, []}}, {requires, networking}]}). %%--------------------------------------------------------------------------- @@ -300,6 +300,8 @@ start() -> %% We do not want to HiPE compile or upgrade %% mnesia after just restarting the app ok = ensure_application_loaded(), + ok = rabbit_node_monitor:prepare_cluster_status_files(), + ok = rabbit_mnesia:check_cluster_consistency(), ok = ensure_working_log_handlers(), ok = app_utils:start_applications( app_startup_order(), fun handle_app_error/2), @@ -310,8 +312,13 @@ boot() -> start_it(fun() -> ok = ensure_application_loaded(), maybe_hipe_compile(), + ok = rabbit_node_monitor:prepare_cluster_status_files(), ok = ensure_working_log_handlers(), ok = rabbit_upgrade:maybe_upgrade_mnesia(), + %% It's important that the consistency check happens after + %% the upgrade, since if we are a secondary node the + %% primary node will have forgotten us + ok = rabbit_mnesia:check_cluster_consistency(), Plugins = rabbit_plugins:setup(), ToBeLoaded = Plugins ++ ?APPS, ok = app_utils:load_applications(ToBeLoaded), @@ -416,7 +423,6 @@ start(normal, []) -> end. stop(_State) -> - ok = rabbit_mnesia:record_running_nodes(), terminated_ok = error_logger:delete_report_handler(rabbit_error_logger), ok = rabbit_alarm:stop(), ok = case rabbit_mnesia:is_clustered() of @@ -513,12 +519,12 @@ sort_boot_steps(UnsortedSteps) -> end. boot_error({error, {timeout_waiting_for_tables, _}}, _Stacktrace) -> + AllNodes = rabbit_mnesia:all_clustered_nodes(), {Err, Nodes} = - case rabbit_mnesia:read_previously_running_nodes() of + case AllNodes -- [node()] of [] -> {"Timeout contacting cluster nodes. Since RabbitMQ was" " shut down forcefully~nit cannot determine which nodes" - " are timing out. Details on all nodes will~nfollow.~n", - rabbit_mnesia:all_clustered_nodes() -- [node()]}; + " are timing out.~n", []}; Ns -> {rabbit_misc:format( "Timeout contacting cluster nodes: ~p.~n", [Ns]), Ns} |
