diff options
| -rw-r--r-- | src/rabbit_mnesia.erl | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl index 6470dc0ac0..dbb270a1fa 100644 --- a/src/rabbit_mnesia.erl +++ b/src/rabbit_mnesia.erl @@ -234,21 +234,23 @@ ensure_mnesia_not_running() -> check_schema_integrity() -> TabDefs = table_definitions(), - try - [Failure || Tab <- table_names(), - begin - {_, TabDef} = proplists:lookup(Tab, TabDefs), - {_, ExpAttrs} = proplists:lookup(attributes, TabDef), - Attrs = mnesia:table_info(Tab, attributes), - Failure = {table_attributes_mismatch, Tab, ExpAttrs, Attrs}, - Attrs /= ExpAttrs - end] - of + Tables = mnesia:system_info(tables), + case [Failure || Tab <- table_names(), + begin + {_, TabDef} = proplists:lookup(Tab, TabDefs), + {_, ExpAttrs} = proplists:lookup(attributes, TabDef), + case lists:member(Tab, Tables) of + false -> Failure = {table_missing, Tab}, + true; + true -> Attrs = mnesia:table_info( + Tab, attributes), + Failure = {table_attributes_mismatch, Tab, + ExpAttrs, Attrs}, + Attrs /= ExpAttrs + end + end] of [] -> ok; Ps -> {error, Ps} - catch - exit:Reason -> - {error, Reason} end. %% The cluster node config file contains some or all of the disk nodes |
