aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2017-12-14 10:31:45 +0100
committerDan Gudmundsson <[email protected]>2017-12-14 10:31:45 +0100
commit1df585794e2d54a42728ba32d23e41ef3de961d1 (patch)
treee3747860a92707279f6150269848819bf3b92713
parente64a1f429ec5f7534e0201fed42967aeb1aae8d8 (diff)
downloadotp-1df585794e2d54a42728ba32d23e41ef3de961d1.tar.gz
otp-1df585794e2d54a42728ba32d23e41ef3de961d1.tar.bz2
otp-1df585794e2d54a42728ba32d23e41ef3de961d1.zip
mnesia: Read schema user properties directly
Doing a proper transaction handling of user properties (in current implmenentation) caused schema_transactions to be quadratic which caused huge startup times for nodes with many tables since the merge schema is a schema_transaction. Do a direct read instead, cheap but implies that the plugin changes will not be visible until the changes are commited and cannot be used later in same transaction, which was possible before if undocumented functions where used.
-rw-r--r--lib/mnesia/src/mnesia_schema.erl16
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/mnesia/src/mnesia_schema.erl b/lib/mnesia/src/mnesia_schema.erl
index 0e4017e4c3..bb5e38f7c1 100644
--- a/lib/mnesia/src/mnesia_schema.erl
+++ b/lib/mnesia/src/mnesia_schema.erl
@@ -952,19 +952,9 @@ get_index_plugins() ->
get_schema_user_property(mnesia_index_plugins).
get_schema_user_property(Key) ->
- Tab = schema,
- %% Must work reliably both within transactions and outside of transactions
- Res = case get(mnesia_activity_state) of
- undefined ->
- dirty_read_table_property(Tab, Key);
- _ ->
- do_read_table_property(Tab, Key)
- end,
- case Res of
- undefined ->
- [];
- {_, Types} ->
- Types
+ case dirty_read_table_property(schema, Key) of
+ undefined -> [];
+ {_, Types} -> Types
end.
get_ext_types_disc() ->