summaryrefslogtreecommitdiff
path: root/src/rabbit_upgrade.erl
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2011-03-23 12:11:01 +0000
committerMatthew Sackman <matthew@rabbitmq.com>2011-03-23 12:11:01 +0000
commit2a4f51d39b3f291a7cd7e8e9f084cee8386a8712 (patch)
treeb64844c67fcc24a1e246dc33c7517b515fa26db1 /src/rabbit_upgrade.erl
parent8b16025be7faf2a5a4d4e403d2150a97e03994be (diff)
downloadrabbitmq-server-2a4f51d39b3f291a7cd7e8e9f084cee8386a8712.tar.gz
sort out how often and when we do the rabbit:prepare (set up log handlers), and actually make that do the mnesia upgrade.
Diffstat (limited to 'src/rabbit_upgrade.erl')
-rw-r--r--src/rabbit_upgrade.erl10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/rabbit_upgrade.erl b/src/rabbit_upgrade.erl
index 87a22363..f2d38a93 100644
--- a/src/rabbit_upgrade.erl
+++ b/src/rabbit_upgrade.erl
@@ -101,7 +101,6 @@ ensure_backup_taken() ->
end.
take_backup() ->
- rabbit:prepare(), %% Ensure we have logs for this
BackupDir = backup_dir(),
case rabbit_mnesia:copy_db(BackupDir) of
ok -> info("upgrades: Mnesia dir backed up to ~p~n",
@@ -134,12 +133,11 @@ maybe_upgrade_mnesia() ->
{ok, []} ->
ok;
{ok, Upgrades} ->
- rabbit:prepare(), %% Ensure we have logs for this
ensure_backup_taken(),
- case upgrade_mode(AllNodes) of
- primary -> primary_upgrade(Upgrades, AllNodes);
- secondary -> secondary_upgrade(AllNodes)
- end
+ ok = case upgrade_mode(AllNodes) of
+ primary -> primary_upgrade(Upgrades, AllNodes);
+ secondary -> secondary_upgrade(AllNodes)
+ end
end.
upgrade_mode(AllNodes) ->