diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2011-03-21 14:22:51 +0000 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2011-03-21 14:22:51 +0000 |
commit | b38be006e69e96cdd2e81929b874cd43bad0b9f0 (patch) | |
tree | f6c8bacdc3a399fc5216096fef4951a31f1609a5 | |
parent | 76d67a38fb7a5e003443869555e305ee5f945069 (diff) | |
download | rabbitmq-server-b38be006e69e96cdd2e81929b874cd43bad0b9f0.tar.gz |
maybe_remove_backup is safe when returning version_not_available since we would not have taken a backup in the first place. However, this is not exactly obvious, so let's not do that.
-rw-r--r-- | src/rabbit_upgrade.erl | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/rabbit_upgrade.erl b/src/rabbit_upgrade.erl index b9c7b8dc..73c9ee2b 100644 --- a/src/rabbit_upgrade.erl +++ b/src/rabbit_upgrade.erl @@ -273,16 +273,15 @@ node_running(Node) -> %% ------------------------------------------------------------------- maybe_upgrade_local() -> - Res = case rabbit_version:upgrades_required(local) of - {error, version_not_available} -> version_not_available; - {error, _} = Err -> throw(Err); - {ok, []} -> ok; - {ok, Upgrades} -> mnesia:stop(), - apply_upgrades(local, Upgrades, - fun () -> ok end) - end, - maybe_remove_backup(), - Res. + case rabbit_version:upgrades_required(local) of + {error, version_not_available} -> version_not_available; + {error, _} = Err -> throw(Err); + {ok, []} -> maybe_remove_backup(); + {ok, Upgrades} -> mnesia:stop(), + apply_upgrades(local, Upgrades, + fun () -> ok end), + maybe_remove_backup() + end. %% ------------------------------------------------------------------- |