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 | 64e2dc821b174af1f324bb7ae634b0d30d9214e0 (patch) | |
tree | 90648d65718caf3029a409e10423615dc77fd3fd | |
parent | 6757adac1ca87455fb9c89ecf1219f5d0ae645ab (diff) | |
download | rabbitmq-server-64e2dc821b174af1f324bb7ae634b0d30d9214e0.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 acf45bf3..d8c53c7a 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). |