fix(mria): Replace mnesia calls with mria
This commit is contained in:
parent
fca7fd755d
commit
6ef68f8e2c
|
@ -273,7 +273,7 @@ trans(Fun, Args) ->
|
|||
{WPid, RefMon} =
|
||||
spawn_monitor(
|
||||
%% NOTE: this is under the assumption that crashes in Fun
|
||||
%% are caught by mnesia:transaction/2.
|
||||
%% are caught by mria:transaction/2.
|
||||
%% Future changes should keep in mind that this process
|
||||
%% always exit with database write result.
|
||||
fun() ->
|
||||
|
|
|
@ -188,6 +188,6 @@ t_delete3(_) ->
|
|||
clear_tables() -> emqx_trie:clear_tables().
|
||||
|
||||
trans(Fun) ->
|
||||
mnesia:transaction(Fun).
|
||||
mria:transaction(?ROUTE_SHARD, Fun).
|
||||
trans(Fun, Args) ->
|
||||
mnesia:transaction(Fun, Args).
|
||||
mria:transaction(?ROUTE_SHARD, Fun, Args).
|
||||
|
|
|
@ -54,19 +54,19 @@ end_per_suite(_Config) ->
|
|||
ok.
|
||||
|
||||
init_per_testcase(t_authz, Config) ->
|
||||
mnesia:transaction(fun mria:dirty_write/1, [#emqx_acl{who = {?ACL_TABLE_USERNAME, <<"test_username">>},
|
||||
rules = [{allow, publish, <<"test/%u">>},
|
||||
{allow, subscribe, <<"eq #">>}
|
||||
]
|
||||
}]),
|
||||
mnesia:transaction(fun mria:dirty_write/1, [#emqx_acl{who = {?ACL_TABLE_CLIENTID, <<"test_clientid">>},
|
||||
rules = [{allow, publish, <<"test/%c">>},
|
||||
{deny, subscribe, <<"eq #">>}
|
||||
]
|
||||
}]),
|
||||
mnesia:transaction(fun mria:dirty_write/1, [#emqx_acl{who = ?ACL_TABLE_ALL,
|
||||
rules = [{deny, all, <<"#">>}]
|
||||
}]),
|
||||
mria:dirty_write(#emqx_acl{who = {?ACL_TABLE_USERNAME, <<"test_username">>},
|
||||
rules = [{allow, publish, <<"test/%u">>},
|
||||
{allow, subscribe, <<"eq #">>}
|
||||
]
|
||||
}),
|
||||
mria:dirty_write(#emqx_acl{who = {?ACL_TABLE_CLIENTID, <<"test_clientid">>},
|
||||
rules = [{allow, publish, <<"test/%c">>},
|
||||
{deny, subscribe, <<"eq #">>}
|
||||
]
|
||||
}),
|
||||
mria:dirty_write(#emqx_acl{who = ?ACL_TABLE_ALL,
|
||||
rules = [{deny, all, <<"#">>}]
|
||||
}),
|
||||
Config;
|
||||
init_per_testcase(_, Config) -> Config.
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ get_telemetry() ->
|
|||
%% gen_server callbacks
|
||||
%%--------------------------------------------------------------------
|
||||
|
||||
%% This is to suppress dialyzer warnings for mnesia:dirty_write and
|
||||
%% This is to suppress dialyzer warnings for mria:dirty_write and
|
||||
%% dirty_read race condition. Given that the init function is not evaluated
|
||||
%% concurrently in one node, it should be free of race condition.
|
||||
%% Given the chance of having two nodes bootstraping with the write
|
||||
|
|
Loading…
Reference in New Issue