diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2012-09-18 15:51:09 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2012-09-18 15:51:09 +0100 |
| commit | 2d024373c6791988ba707d2b80c91786819be00b (patch) | |
| tree | faae41dd8ca19bb5cb371823d24d3c0cd713c3b8 /src/rabbit.erl | |
| parent | 20a051f19cb338823f488c02a7d07c51d4f75066 (diff) | |
| parent | 13c794e13636bc9cf4c91d6c44bd58ed3c9d0cac (diff) | |
| download | rabbitmq-server-git-2d024373c6791988ba707d2b80c91786819be00b.tar.gz | |
Merge bug24997
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 ed258c71c9..7a021e378d 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()), ok = print_plugin_info(rabbit_plugins:active()) @@ -309,8 +311,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), @@ -408,7 +415,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 @@ -505,12 +511,12 @@ sort_boot_steps(UnsortedSteps) -> end. boot_step_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} |
