chore(mria): ekka_rlog -> mria_rlog

This commit is contained in:
k32 2021-10-14 21:49:07 +02:00 committed by x1001100011
parent 3e8b9ff76a
commit 1a473bb73b
12 changed files with 12 additions and 12 deletions

View File

@ -57,7 +57,7 @@ stop(_State) -> ok.
ensure_ekka_started() -> ensure_ekka_started() ->
ekka:start(), ekka:start(),
ok = ekka_rlog:wait_for_shards(?BOOT_SHARDS, infinity). ok = mria_rlog:wait_for_shards(?BOOT_SHARDS, infinity).
%% @doc Call this function to make emqx boot without loading config, %% @doc Call this function to make emqx boot without loading config,
%% in case we want to delegate the config load to a higher level app %% in case we want to delegate the config load to a higher level app

View File

@ -108,7 +108,7 @@ init([]) ->
{attributes, record_info(fields, channel)}, {attributes, record_info(fields, channel)},
{storage_properties, [{ets, [{read_concurrency, true}, {storage_properties, [{ets, [{read_concurrency, true},
{write_concurrency, true}]}]}]), {write_concurrency, true}]}]}]),
ok = ekka_rlog:wait_for_shards([?CM_SHARD], infinity), ok = mria_rlog:wait_for_shards([?CM_SHARD], infinity),
ok = ekka:monitor(membership), ok = ekka:monitor(membership),
{ok, #{}}. {ok, #{}}.

View File

@ -252,7 +252,7 @@ maybe_trans(Fun, Args) ->
trans(Fun, Args); trans(Fun, Args);
global -> global ->
%% Assert: %% Assert:
mnesia = ekka_rlog:backend(), %% TODO: do something smarter than just crash mnesia = mria_rlog:backend(), %% TODO: do something smarter than just crash
lock_router(), lock_router(),
try mnesia:sync_dirty(Fun, Args) try mnesia:sync_dirty(Fun, Args)
after after

View File

@ -30,7 +30,7 @@
%%------------------------------------------------------------------------------ %%------------------------------------------------------------------------------
start(_StartType, _StartArgs) -> start(_StartType, _StartArgs) ->
ok = ekka_rlog:wait_for_shards([?AUTH_SHARD], infinity), ok = mria_rlog:wait_for_shards([?AUTH_SHARD], infinity),
{ok, Sup} = emqx_authn_sup:start_link(), {ok, Sup} = emqx_authn_sup:start_link(),
ok = ?AUTHN:register_providers(providers()), ok = ?AUTHN:register_providers(providers()),
ok = initialize(), ok = initialize(),

View File

@ -12,7 +12,7 @@
-export([start/2, stop/1]). -export([start/2, stop/1]).
start(_StartType, _StartArgs) -> start(_StartType, _StartArgs) ->
ok = ekka_rlog:wait_for_shards([?ACL_SHARDED], infinity), ok = mria_rlog:wait_for_shards([?ACL_SHARDED], infinity),
{ok, Sup} = emqx_authz_sup:start_link(), {ok, Sup} = emqx_authz_sup:start_link(),
ok = emqx_authz:init(), ok = emqx_authz:init(),
{ok, Sup}. {ok, Sup}.

View File

@ -26,7 +26,7 @@
start(_StartType, _StartArgs) -> start(_StartType, _StartArgs) ->
{ok, Sup} = emqx_dashboard_sup:start_link(), {ok, Sup} = emqx_dashboard_sup:start_link(),
ok = ekka_rlog:wait_for_shards([?DASHBOARD_SHARD], infinity), ok = mria_rlog:wait_for_shards([?DASHBOARD_SHARD], infinity),
_ = emqx_dashboard:start_listeners(), _ = emqx_dashboard:start_listeners(),
emqx_dashboard_cli:load(), emqx_dashboard_cli:load(),
ok = emqx_dashboard_admin:add_default_user(), ok = emqx_dashboard_admin:add_default_user(),

View File

@ -146,7 +146,7 @@ init([InstaId, PredefTopics]) ->
]), ]),
ok = mria:wait_for_tables([Tab]), ok = mria:wait_for_tables([Tab]),
% FIXME: % FIXME:
%ok = ekka_rlog:wait_for_shards([?CM_SHARD], infinity), %ok = mria_rlog:wait_for_shards([?CM_SHARD], infinity),
MaxPredefId = lists:foldl( MaxPredefId = lists:foldl(
fun(#{id := TopicId, topic := TopicName0}, AccId) -> fun(#{id := TopicId, topic := TopicName0}, AccId) ->
TopicName = iolist_to_binary(TopicName0), TopicName = iolist_to_binary(TopicName0),

View File

@ -84,7 +84,7 @@ multicall(M, F, A, RequireNum, Timeout) when RequireNum =:= all orelse RequireNu
MFA = {initiate, {M, F, A}}, MFA = {initiate, {M, F, A}},
Begin = erlang:monotonic_time(), Begin = erlang:monotonic_time(),
InitRes = InitRes =
case ekka_rlog:role() of case mria_rlog:role() of
core -> gen_server:call(?MODULE, MFA, Timeout); core -> gen_server:call(?MODULE, MFA, Timeout);
replicant -> replicant ->
%% the initiate transaction must happened on core node %% the initiate transaction must happened on core node

View File

@ -36,7 +36,7 @@ start() ->
ok = print_otp_version_warning(), ok = print_otp_version_warning(),
ok = load_config_files(), ok = load_config_files(),
ekka:start(), ekka:start(),
ekka_rlog:wait_for_shards([?EMQX_MACHINE_SHARD], infinity), mria_rlog:wait_for_shards([?EMQX_MACHINE_SHARD], infinity),
ok. ok.
graceful_shutdown() -> graceful_shutdown() ->

View File

@ -43,7 +43,7 @@ init_per_suite(Config) ->
application:load(emqx), application:load(emqx),
application:load(emqx_machine), application:load(emqx_machine),
ok = ekka:start(), ok = ekka:start(),
ok = ekka_rlog:wait_for_shards([?EMQX_MACHINE_SHARD], infinity), ok = mria_rlog:wait_for_shards([?EMQX_MACHINE_SHARD], infinity),
application:set_env(emqx_machine, cluster_call_max_history, 100), application:set_env(emqx_machine, cluster_call_max_history, 100),
application:set_env(emqx_machine, cluster_call_clean_interval, 1000), application:set_env(emqx_machine, cluster_call_clean_interval, 1000),
application:set_env(emqx_machine, cluster_call_retry_interval, 900), application:set_env(emqx_machine, cluster_call_retry_interval, 900),

View File

@ -28,7 +28,7 @@
start(_Type, _Args) -> start(_Type, _Args) ->
{ok, Sup} = emqx_mgmt_sup:start_link(), {ok, Sup} = emqx_mgmt_sup:start_link(),
ok = ekka_rlog:wait_for_shards([?MANAGEMENT_SHARD], infinity), ok = mria_rlog:wait_for_shards([?MANAGEMENT_SHARD], infinity),
emqx_mgmt_cli:load(), emqx_mgmt_cli:load(),
{ok, Sup}. {ok, Sup}.

View File

@ -59,7 +59,7 @@ create_resource(#{storage_type := StorageType}) ->
{record_name, retained}, {record_name, retained},
{attributes, record_info(fields, retained)}, {attributes, record_info(fields, retained)},
{storage_properties, StoreProps}]), {storage_properties, StoreProps}]),
ok = ekka_rlog:wait_for_shards([?RETAINER_SHARD], infinity), ok = mria_rlog:wait_for_shards([?RETAINER_SHARD], infinity),
case mnesia:table_info(?TAB, storage_type) of case mnesia:table_info(?TAB, storage_type) of
Copies -> ok; Copies -> ok;
_Other -> _Other ->