fix: redact status when mark_fix_log begin

This commit is contained in:
zhongwencool 2024-07-08 17:32:45 +08:00
parent 457ea93570
commit 820789a09f
2 changed files with 9 additions and 5 deletions

View File

@ -43,7 +43,7 @@
get_cluster_tnx_id/0,
get_node_tnx_id/1,
init_mfa/2,
update_mfa_in_trans/3,
force_sync_tnx_id/3,
latest_tnx_id/0,
make_initiate_call_req/3,
read_next_mfa/1,
@ -548,7 +548,7 @@ init_mfa(Node, MFA) ->
{retry, Meta}
end.
update_mfa_in_trans(Node, MFA, NodeTnxId) ->
force_sync_tnx_id(Node, MFA, NodeTnxId) ->
mnesia:write_lock_table(?CLUSTER_MFA),
case get_node_tnx_id(Node) of
NodeTnxId ->
@ -567,13 +567,13 @@ update_mfa_in_trans(Node, MFA, NodeTnxId) ->
mria:running_nodes()
);
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]),
mnesia:abort({error, Reason})
end.
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;
{aborted, Error} -> Error
end.

View File

@ -155,7 +155,11 @@ mark_fix_begin(Node, TnxId) ->
emqx_cluster_rpc:update_mfa(Node, MFA, TnxId).
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.
audit(Level, From, Log) ->