summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2010-07-22 16:00:41 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2010-07-22 16:00:41 +0100
commit44aa92813fc005dcbb77fa77d0fd99fe455d269b (patch)
treef9f14ba4c08873aed407ec408065320ee7ec51c0
parent8fe39e57d56d08bb803424e914bf51b2adaaab1b (diff)
parenta6734af774f31f2d8cf05b1a17817592cdd46006 (diff)
downloadrabbitmq-server-44aa92813fc005dcbb77fa77d0fd99fe455d269b.tar.gz
merge heads
-rw-r--r--src/rabbit_mnesia.erl13
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)},