fix: redact status when mark_fix_log begin
This commit is contained in:
parent
457ea93570
commit
820789a09f
|
@ -43,7 +43,7 @@
|
||||||
get_cluster_tnx_id/0,
|
get_cluster_tnx_id/0,
|
||||||
get_node_tnx_id/1,
|
get_node_tnx_id/1,
|
||||||
init_mfa/2,
|
init_mfa/2,
|
||||||
update_mfa_in_trans/3,
|
force_sync_tnx_id/3,
|
||||||
latest_tnx_id/0,
|
latest_tnx_id/0,
|
||||||
make_initiate_call_req/3,
|
make_initiate_call_req/3,
|
||||||
read_next_mfa/1,
|
read_next_mfa/1,
|
||||||
|
@ -548,7 +548,7 @@ init_mfa(Node, MFA) ->
|
||||||
{retry, Meta}
|
{retry, Meta}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
update_mfa_in_trans(Node, MFA, NodeTnxId) ->
|
force_sync_tnx_id(Node, MFA, NodeTnxId) ->
|
||||||
mnesia:write_lock_table(?CLUSTER_MFA),
|
mnesia:write_lock_table(?CLUSTER_MFA),
|
||||||
case get_node_tnx_id(Node) of
|
case get_node_tnx_id(Node) of
|
||||||
NodeTnxId ->
|
NodeTnxId ->
|
||||||
|
@ -567,13 +567,13 @@ update_mfa_in_trans(Node, MFA, NodeTnxId) ->
|
||||||
mria:running_nodes()
|
mria:running_nodes()
|
||||||
);
|
);
|
||||||
NewTnxId ->
|
NewTnxId ->
|
||||||
Fmt = "someone_has_already_updated,tnx_id(~w) is not the latest(~w)",
|
Fmt = "aborted_force_sync, tnx_id(~w) is not the latest(~w)",
|
||||||
Reason = emqx_utils:format(Fmt, [NodeTnxId, NewTnxId]),
|
Reason = emqx_utils:format(Fmt, [NodeTnxId, NewTnxId]),
|
||||||
mnesia:abort({error, Reason})
|
mnesia:abort({error, Reason})
|
||||||
end.
|
end.
|
||||||
|
|
||||||
update_mfa(Node, MFA, LatestId) ->
|
update_mfa(Node, MFA, LatestId) ->
|
||||||
case transaction(fun ?MODULE:update_mfa_in_trans/3, [Node, MFA, LatestId]) of
|
case transaction(fun ?MODULE:force_sync_tnx_id/3, [Node, MFA, LatestId]) of
|
||||||
{atomic, ok} -> ok;
|
{atomic, ok} -> ok;
|
||||||
{aborted, Error} -> Error
|
{aborted, Error} -> Error
|
||||||
end.
|
end.
|
||||||
|
|
|
@ -155,7 +155,11 @@ mark_fix_begin(Node, TnxId) ->
|
||||||
emqx_cluster_rpc:update_mfa(Node, MFA, TnxId).
|
emqx_cluster_rpc:update_mfa(Node, MFA, TnxId).
|
||||||
|
|
||||||
mark_fix_log(Status, Opts) ->
|
mark_fix_log(Status, Opts) ->
|
||||||
?SLOG(warning, #{msg => cluster_fix_log, status => Status, opts => Opts}),
|
?SLOG(warning, #{
|
||||||
|
msg => cluster_config_sync_triggered,
|
||||||
|
status => emqx_utils:redact(Status),
|
||||||
|
opts => Opts
|
||||||
|
}),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
audit(Level, From, Log) ->
|
audit(Level, From, Log) ->
|
||||||
|
|
Loading…
Reference in New Issue