summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniil Fedotov <hairyhum@gmail.com>2019-03-22 15:13:28 -0400
committerDaniil Fedotov <hairyhum@gmail.com>2019-03-22 15:13:28 -0400
commit6e21ea6602da4e8be990977d0c54b5246ba93de6 (patch)
tree4e1cac7308b59b0cc60000d6a4e559b68da62113 /src
parent6e54d77439e2466ea41f0cbf2fc9600f02467157 (diff)
downloadrabbitmq-server-git-6e21ea6602da4e8be990977d0c54b5246ba93de6.tar.gz
Use ram schema_location for mnesia consistency checks.
By default mnesia uses opt_disk schema location, which will use a disk schema if there is a directory. This also applies to the autogenerated directory. In some cases if the data directory has an autogenerated schema directory left from previous versions - the node startup will fail. There is no point in reading a schema on consistency check anyway. [#164807008]
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_mnesia.erl3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl
index 65383b80af..162badc33d 100644
--- a/src/rabbit_mnesia.erl
+++ b/src/rabbit_mnesia.erl
@@ -945,10 +945,13 @@ with_running_or_clean_mnesia(Fun) ->
false ->
SavedMnesiaDir = dir(),
application:unset_env(mnesia, dir),
+ SchemaLoc = application:get_env(mnesia, schema_location, opt_disc),
+ application:set_env(mnesia, schema_location, ram),
mnesia:start(),
Result = Fun(),
application:stop(mnesia),
application:set_env(mnesia, dir, SavedMnesiaDir),
+ application:set_env(mnesia, schema_location, SchemaLoc),
Result
end.