summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2011-03-18 12:15:51 +0000
committerSimon MacMullen <simon@rabbitmq.com>2011-03-18 12:15:51 +0000
commit3ae4322d27ee90b19d774418c43fd7e8a0b75ac4 (patch)
treea699237675223baa43776f69a9e8bad54277618d
parent349c24621ca359b5e6deac9d43ed8cefd0616152 (diff)
downloadrabbitmq-server-3ae4322d27ee90b19d774418c43fd7e8a0b75ac4.tar.gz
Ensure mnesia is stopped for the local upgrade backup.
-rw-r--r--src/rabbit_upgrade.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rabbit_upgrade.erl b/src/rabbit_upgrade.erl
index b4e1191e..2c31e602 100644
--- a/src/rabbit_upgrade.erl
+++ b/src/rabbit_upgrade.erl
@@ -182,7 +182,6 @@ primary_upgrade(Upgrades, Nodes) ->
mnesia,
Upgrades,
fun () ->
- rabbit_misc:ensure_ok(mnesia:start(), cannot_start_mnesia),
force_tables(),
case Others of
[] -> ok;
@@ -227,7 +226,8 @@ maybe_upgrade_local() ->
{error, version_not_available} -> version_not_available;
{error, _} = Err -> throw(Err);
{ok, []} -> ok;
- {ok, Upgrades} -> apply_upgrades(local, Upgrades,
+ {ok, Upgrades} -> mnesia:stop(),
+ apply_upgrades(local, Upgrades,
fun () -> ok end)
end.
@@ -249,6 +249,7 @@ apply_upgrades(Scope, Upgrades, Fun) ->
ok = file:delete(lock_filename(BackupDir)),
info("~s upgrades: Mnesia dir backed up to ~p~n",
[Scope, BackupDir]),
+ rabbit_misc:ensure_ok(mnesia:start(), cannot_start_mnesia),
Fun(),
[apply_upgrade(Scope, Upgrade) || Upgrade <- Upgrades],
info("~s upgrades: All upgrades applied successfully~n",