summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2011-05-25 13:42:34 +0100
committerMatthew Sackman <matthew@rabbitmq.com>2011-05-25 13:42:34 +0100
commit6a8b341e4c4bd6a7f3c08f005416defc20077b91 (patch)
treec65b1dfcc79e229343a2808fff66e468a4ff9e7f
parent36f68e916ff7319e027b7545d987ecd920284324 (diff)
downloadrabbitmq-server-6a8b341e4c4bd6a7f3c08f005416defc20077b91.tar.gz
Work in gm table creation as part of the normal upgrade steps, and then assume that it'll continue to exist
-rw-r--r--src/rabbit_mirror_queue_coordinator.erl1
-rw-r--r--src/rabbit_mirror_queue_slave.erl1
-rw-r--r--src/rabbit_upgrade_functions.erl22
3 files changed, 14 insertions, 10 deletions
diff --git a/src/rabbit_mirror_queue_coordinator.erl b/src/rabbit_mirror_queue_coordinator.erl
index ee849088..2727c1d0 100644
--- a/src/rabbit_mirror_queue_coordinator.erl
+++ b/src/rabbit_mirror_queue_coordinator.erl
@@ -324,7 +324,6 @@ ensure_monitoring(CPid, Pids) ->
init([#amqqueue { name = QueueName } = Q, GM, DeathFun]) ->
GM1 = case GM of
undefined ->
- ok = gm:create_tables(),
{ok, GM2} = gm:start_link(QueueName, ?MODULE, [self()]),
receive {joined, GM2, _Members} ->
ok
diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl
index 666687a5..678926af 100644
--- a/src/rabbit_mirror_queue_slave.erl
+++ b/src/rabbit_mirror_queue_slave.erl
@@ -75,7 +75,6 @@ set_maximum_since_use(QPid, Age) ->
init([#amqqueue { name = QueueName } = Q]) ->
process_flag(trap_exit, true), %% amqqueue_process traps exits too.
- ok = gm:create_tables(),
{ok, GM} = gm:start_link(QueueName, ?MODULE, [self()]),
receive {joined, GM} ->
ok
diff --git a/src/rabbit_upgrade_functions.erl b/src/rabbit_upgrade_functions.erl
index a6f02a0e..04744aa4 100644
--- a/src/rabbit_upgrade_functions.erl
+++ b/src/rabbit_upgrade_functions.erl
@@ -30,21 +30,23 @@
-rabbit_upgrade({exchange_event_serial, mnesia, []}).
-rabbit_upgrade({trace_exchanges, mnesia, []}).
-rabbit_upgrade({mirror_pids, mnesia, []}).
+-rabbit_upgrade({gm, mnesia, []}).
%% -------------------------------------------------------------------
-ifdef(use_specs).
--spec(remove_user_scope/0 :: () -> 'ok').
--spec(hash_passwords/0 :: () -> 'ok').
--spec(add_ip_to_listener/0 :: () -> 'ok').
--spec(internal_exchanges/0 :: () -> 'ok').
+-spec(remove_user_scope/0 :: () -> 'ok').
+-spec(hash_passwords/0 :: () -> 'ok').
+-spec(add_ip_to_listener/0 :: () -> 'ok').
+-spec(internal_exchanges/0 :: () -> 'ok').
-spec(user_to_internal_user/0 :: () -> 'ok').
--spec(topic_trie/0 :: () -> 'ok').
+-spec(topic_trie/0 :: () -> 'ok').
-spec(exchange_event_serial/0 :: () -> 'ok').
--spec(semi_durable_route/0 :: () -> 'ok').
--spec(trace_exchanges/0 :: () -> 'ok').
--spec(mirror_pids/0 :: () -> 'ok').
+-spec(semi_durable_route/0 :: () -> 'ok').
+-spec(trace_exchanges/0 :: () -> 'ok').
+-spec(mirror_pids/0 :: () -> 'ok').
+-spec(gm/0 :: () -> 'ok').
-endif.
@@ -136,6 +138,10 @@ mirror_pids() ->
|| T <- Tables ],
ok.
+gm() ->
+ create(gm_group, [{record_name, gm_group},
+ {attributes, [name, version, members]}]).
+
%%--------------------------------------------------------------------
transform(TableName, Fun, FieldList) ->