fix: copy cluster-override.conf from old version
This commit is contained in:
parent
6ef032026f
commit
5593e38ed3
|
@ -1,6 +1,6 @@
|
||||||
{application, emqx_conf, [
|
{application, emqx_conf, [
|
||||||
{description, "EMQX configuration management"},
|
{description, "EMQX configuration management"},
|
||||||
{vsn, "0.1.17"},
|
{vsn, "0.1.18"},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{mod, {emqx_conf_app, []}},
|
{mod, {emqx_conf_app, []}},
|
||||||
{applications, [kernel, stdlib, emqx_ctl]},
|
{applications, [kernel, stdlib, emqx_ctl]},
|
||||||
|
|
|
@ -175,7 +175,7 @@ copy_override_conf_from_core_node() ->
|
||||||
_ ->
|
_ ->
|
||||||
[{ok, Info} | _] = lists:sort(fun conf_sort/2, Ready),
|
[{ok, Info} | _] = lists:sort(fun conf_sort/2, Ready),
|
||||||
#{node := Node, conf := RawOverrideConf, tnx_id := TnxId} = Info,
|
#{node := Node, conf := RawOverrideConf, tnx_id := TnxId} = Info,
|
||||||
HasDeprecatedFile = maps:get(has_deprecated_file, Info, false),
|
HasDeprecatedFile = has_deprecated_file(Info),
|
||||||
?SLOG(debug, #{
|
?SLOG(debug, #{
|
||||||
msg => "copy_cluster_conf_from_core_node_success",
|
msg => "copy_cluster_conf_from_core_node_success",
|
||||||
node => Node,
|
node => Node,
|
||||||
|
@ -227,3 +227,16 @@ sync_data_from_node(Node) ->
|
||||||
?SLOG(emergency, #{node => Node, msg => "sync_data_from_node_failed", reason => Error}),
|
?SLOG(emergency, #{node => Node, msg => "sync_data_from_node_failed", reason => Error}),
|
||||||
error(Error)
|
error(Error)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
has_deprecated_file(#{node := Node} = Info) ->
|
||||||
|
case maps:find(has_deprecated_file, Info) of
|
||||||
|
{ok, HasDeprecatedFile} ->
|
||||||
|
HasDeprecatedFile;
|
||||||
|
error ->
|
||||||
|
%% The old version don't have emqx_config:has_deprecated_file/0
|
||||||
|
Timeout = 5000,
|
||||||
|
{ok, File} = rpc:call(
|
||||||
|
Node, application, get_env, [emqx, cluster_override_conf_file], Timeout
|
||||||
|
),
|
||||||
|
rpc:call(Node, filelib, is_regular, [File], Timeout)
|
||||||
|
end.
|
||||||
|
|
Loading…
Reference in New Issue