diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2011-07-07 11:58:20 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2011-07-07 11:58:20 +0100 |
| commit | c8d480351b9db984a86fc6cd6be8dea3e5c5846e (patch) | |
| tree | 90648d65718caf3029a409e10423615dc77fd3fd | |
| parent | eb14007e10d7e847aa6916fbb8c12f27c255d0ca (diff) | |
| download | rabbitmq-server-git-c8d480351b9db984a86fc6cd6be8dea3e5c5846e.tar.gz | |
Fix upgrades from 2.4.1 and before. This failed because the #exchange{} record now contains the exchange scratch space, but at the point at which we add trace exchanges Mnesia hasn't got there yet. The moral of this story is: never use record definitions in rabbit_upgrade_functions (which is why all the transform() invocations don't).
| -rw-r--r-- | src/rabbit_upgrade_functions.erl | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/rabbit_upgrade_functions.erl b/src/rabbit_upgrade_functions.erl index acf45bf3e3..d8c53c7a8e 100644 --- a/src/rabbit_upgrade_functions.erl +++ b/src/rabbit_upgrade_functions.erl @@ -16,8 +16,6 @@ -module(rabbit_upgrade_functions). --include("rabbit.hrl"). - -compile([export_all]). -rabbit_upgrade({remove_user_scope, mnesia, []}). @@ -190,11 +188,7 @@ create(Tab, TabDef) -> %% the exchange type registry or worker pool to be running by dint of %% not validating anything and assuming the exchange type does not %% require serialisation. +%% NB: this assumes the pre-exchange-scratch-space format declare_exchange(XName, Type) -> - X = #exchange{name = XName, - type = Type, - durable = true, - auto_delete = false, - internal = false, - arguments = []}, + X = {exchange, XName, Type, true, false, false, []}, ok = mnesia:dirty_write(rabbit_durable_exchange, X). |
