summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2009-06-30 18:04:11 +0100
committerMatthew Sackman <matthew@lshift.net>2009-06-30 18:04:11 +0100
commit267af553fb4af94c6a3a3f8e99b7ec4963be4fa5 (patch)
tree9be88d8cfbf961e3fb2a4e88cdcfdcf6a87c364d
parent20a4eb8757c7536b406affb14d76b3e537e6a7bf (diff)
downloadrabbitmq-server-bug19662.tar.gz
Well, this seems to work.bug19662
-rw-r--r--src/rabbit_mnesia.erl17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl
index 3681af0a..149501f8 100644
--- a/src/rabbit_mnesia.erl
+++ b/src/rabbit_mnesia.erl
@@ -166,6 +166,9 @@ non_replicated_table_definitions() ->
table_names() ->
[Tab || {Tab, _} <- table_definitions()].
+replicated_table_names() ->
+ [Tab || {Tab, _} <- replicated_table_definitions()].
+
dir() -> mnesia:system_info(directory).
ensure_mnesia_dir() ->
@@ -298,10 +301,10 @@ init_db(ClusterNodes) ->
true -> disc;
false -> ram
end,
+ ok = wait_for_replicated_tables(),
ok = create_local_table_copy(schema, disc_copies),
ok = create_local_non_replicated_table_copies(disc),
- ok = create_local_replicated_table_copies(TableCopyType),
- ok = wait_for_tables();
+ ok = create_local_replicated_table_copies(TableCopyType);
{error, Reason} ->
%% one reason we may end up here is if we try to join
%% nodes together that are currently running standalone or
@@ -408,10 +411,16 @@ create_local_table_copy(Tab, Type) ->
end,
ok.
-wait_for_tables() ->
+wait_for_replicated_tables() ->
+ wait_for_tables(replicated_table_names()).
+
+wait_for_tables() ->
+ wait_for_tables(table_names()).
+
+wait_for_tables(TableNames) ->
case check_schema_integrity() of
ok ->
- case mnesia:wait_for_tables(table_names(), 30000) of
+ case mnesia:wait_for_tables(TableNames, 30000) of
ok -> ok;
{timeout, BadTabs} ->
throw({error, {timeout_waiting_for_tables, BadTabs}});