diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2010-07-22 10:32:09 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2010-07-22 10:32:09 +0100 |
commit | a6734af774f31f2d8cf05b1a17817592cdd46006 (patch) | |
tree | c5be2445cace5541e3e0f15342a3ccd8755a8482 | |
parent | a00c6066f4b4b88a2e436206b86e6e28b395e0d8 (diff) | |
parent | 60a75a58c7edf09668ab9770f49a4556539d8b87 (diff) | |
download | rabbitmq-server-a6734af774f31f2d8cf05b1a17817592cdd46006.tar.gz |
Merge bug22992 into default.
-rw-r--r-- | src/rabbit_mnesia.erl | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl index e2b6927f..689f799d 100644 --- a/src/rabbit_mnesia.erl +++ b/src/rabbit_mnesia.erl @@ -77,7 +77,7 @@ status() -> {disc, disc_copies}, {ram, ram_copies}], begin - Nodes = mnesia:table_info(schema, CopyType), + Nodes = nodes_of_type(CopyType), Nodes =/= [] end]; no -> case mnesia:system_info(db_nodes) of @@ -144,6 +144,15 @@ empty_ram_only_tables() -> %%-------------------------------------------------------------------- +nodes_of_type(Type) -> + %% This function should return the nodes of a certain type (ram, + %% disc or disc_only) in the current cluster. The type of nodes + %% is determined when the cluster is initially configured. + %% Specifically, we check whether a certain table, which we know + %% will be written to disk on a disc node, is stored on disk or in + %% RAM. + mnesia:table_info(rabbit_durable_exchange, Type). + table_definitions() -> [{rabbit_user, [{record_name, user}, @@ -175,6 +184,8 @@ table_definitions() -> [{record_name, reverse_route}, {attributes, record_info(fields, reverse_route)}, {type, ordered_set}]}, + %% Consider the implications to nodes_of_type/1 before altering + %% the next entry. {rabbit_durable_exchange, [{record_name, exchange}, {attributes, record_info(fields, exchange)}, |