fix(mgmt_cli): Don't print cluster status on the replicant

This commit is contained in:
ieQu1 2023-07-18 18:07:10 +02:00
parent ce76d4ab04
commit 3a5112829c
2 changed files with 7 additions and 4 deletions

View File

@ -113,7 +113,11 @@ cluster(["join", SNode]) ->
case mria:join(ekka_node:parse_name(SNode)) of
ok ->
emqx_ctl:print("Join the cluster successfully.~n"),
cluster(["status"]);
%% FIXME: running status on the replicant immediately
%% after join produces stale output
mria_rlog:role() =:= core andalso
cluster(["status"]),
ok;
ignore ->
emqx_ctl:print("Ignore.~n");
{error, Error} ->
@ -158,9 +162,7 @@ sort_map_list_fields(Map) when is_map(Map) ->
end,
Map,
maps:keys(Map)
);
sort_map_list_fields(NotMap) ->
NotMap.
).
sort_map_list_field(Field, Map) ->
case maps:get(Field, Map) of

View File

@ -0,0 +1 @@
Fix `emqx_ctl cluster join`, `leave`, and `status` commands.