fix(mria): Hook up mria to emqx_machine

This commit is contained in:
k32 2021-10-15 17:41:03 +02:00 committed by x1001100011
parent e182a5f38c
commit d224687de2
5 changed files with 7 additions and 6 deletions

View File

@ -87,7 +87,7 @@ multicall(M, F, A, RequireNum, Timeout) when RequireNum =:= all orelse RequireNu
%% the initiate transaction must happened on core node
%% make sure MFA(in the transaction) and the transaction on the same node
%% don't need rpc again inside transaction.
case ekka_rlog_status:upstream_node(?EMQX_MACHINE_SHARD) of
case mria_status:upstream_node(?EMQX_MACHINE_SHARD) of
{ok, Node} -> gen_server:call({?MODULE, Node}, MFA, Timeout);
disconnected -> {error, disconnected}
end

View File

@ -35,6 +35,7 @@ start() ->
ok = set_backtrace_depth(),
ok = print_otp_version_warning(),
ok = load_config_files(),
mria:start(),
ekka:start(),
mria_rlog:wait_for_shards([?EMQX_MACHINE_SHARD], infinity),
ok.

View File

@ -147,7 +147,7 @@ fields("cluster") ->
#{})}
, {"db_backend",
sc(hoconsc:enum([mnesia, rlog]),
#{ mapping => "ekka.db_backend"
#{ mapping => "mria.db_backend"
, default => mnesia
})}
, {"rlog",
@ -253,12 +253,12 @@ fields(cluster_k8s) ->
fields("rlog") ->
[ {"role",
sc(hoconsc:enum([core, replicant]),
#{ mapping => "ekka.node_role"
#{ mapping => "mria.node_role"
, default => core
})}
, {"core_nodes",
sc(emqx_schema:comma_separated_atoms(),
#{ mapping => "ekka.core_nodes"
#{ mapping => "mria.core_nodes"
, default => []
})}
];

View File

@ -590,6 +590,6 @@ emqx_cluster() ->
].
emqx_cluster_data() ->
#{running_nodes := Running, stopped_nodes := Stopped} = mria:cluster_info(),
#{running_nodes := Running, stopped_nodes := Stopped} = mria_mnesia:cluster_info(),
[{nodes_running, length(Running)},
{nodes_stopped, length(Stopped)}].

View File

@ -60,7 +60,7 @@ community_plugin_overrides() ->
%% Temporary workaround for a rebar3 erl_opts duplication
%% bug. Ideally, we want to set this define globally
snabbkaffe_overrides() ->
Apps = [snabbkaffe, ekka],
Apps = [snabbkaffe, ekka, mria],
[{add, App, [{erl_opts, [{d, snk_kind, msg}]}]} || App <- Apps].
config(HasElixir) ->