New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EMQX-10590 data import fix missing config relealse 51 #11322
EMQX-10590 data import fix missing config relealse 51 #11322
Conversation
The type resulted in missing `rule_engine` config after importing data from a backup file. Fixes: EMQX-10590
…t/export Fixes: EMQX-10590
6a6413b
to
b37920d
Compare
post_config_update(_, _UpdateReq, NewConfig, OldConfig, _AppEnvs) -> | ||
#{ | ||
removed := Removed, | ||
added := Added | ||
} = emqx_utils:diff_lists(NewConfig, OldConfig, fun(#{topic := T}) -> T end), | ||
Deregistered = [emqx_topic_metrics:deregister(T) || #{topic := T} <- Removed], | ||
Registered = [emqx_topic_metrics:register(T) || #{topic := T} <- Added], | ||
Errs = [Res || Res <- Registered ++ Deregistered, Res =/= ok], | ||
case Errs of | ||
[] -> ok; | ||
_ -> {error, Errs} | ||
end. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch, I can't believe I don't implment config_handler's callback for topic_metrics before.
Nit:
deregister will return ok or topic_not_found, we should mark topic_not_found as deregister success.
register will return ok or already_existed, maybe already_existed is also register success.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @zhongwencool, fixed.
…removed topic metrics
Fixes EMQX-10590
This is the same as #11296, but ported to release-51.
Summary
🤖 Generated by Copilot at 6a6413b
This pull request adds support for importing backup data for the
emqx_modules
application, especially thetopic_metrics
andslow_subs
configurations. It also fixes a typo in theemqx_rule_engine
module and updates the version number and test cases for theemqx_modules
application. The changes are documented in thechanges/ce/fix-11296.en.md
file.PR Checklist
Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:
changes/(ce|ee)/(feat|perf|fix)-<PR-id>.en.md
filesChecklist for CI (.github/workflows) changes
changes/
dir for user-facing artifacts update