refactor: remove relup revert callback functions
This commit is contained in:
parent
eb71477f43
commit
439abe430b
|
@ -16,23 +16,25 @@
|
|||
|
||||
-module(emqx_post_upgrade).
|
||||
|
||||
%% Example of a hot upgrade callback function.
|
||||
%% PR#12765
|
||||
% -export([
|
||||
% pr12765_update_stats_timer/1,
|
||||
% pr12765_revert_stats_timer/1
|
||||
% pr20000_ensure_sup_started/3
|
||||
% ]).
|
||||
|
||||
-include("logger.hrl").
|
||||
|
||||
%%------------------------------------------------------------------------------
|
||||
%% Hot Upgrade Callback Functions.
|
||||
%%------------------------------------------------------------------------------
|
||||
%% Please ensure that every callback function is reentrant.
|
||||
%% This way, users can attempt upgrade multiple times if an issue arises.
|
||||
%%
|
||||
% pr12765_update_stats_timer(_FromVsn) ->
|
||||
% emqx_stats:update_interval(broker_stats, fun emqx_broker_helper:stats_fun/0).
|
||||
|
||||
% pr12765_revert_stats_timer(_ToVsn) ->
|
||||
% emqx_stats:update_interval(broker_stats, fun emqx_broker:stats_fun/0).
|
||||
|
||||
%%------------------------------------------------------------------------------
|
||||
%% Helper functions
|
||||
%%------------------------------------------------------------------------------
|
||||
%
|
||||
% pr20000_ensure_sup_started(_FromVsn, "5.6.1" ++ _, ChildSpec) ->
|
||||
% ChildId = maps:get(id, ChildSpec),
|
||||
% case supervisor:terminate_child(emqx_sup, ChildId) of
|
||||
% ok -> supervisor:delete_child(emqx_sup, ChildId);
|
||||
% Error -> Error
|
||||
% end,
|
||||
% supervisor:start_child(emqx_sup, ChildSpec);
|
||||
% pr20000_ensure_sup_started(_FromVsn, _TargetVsn, _) ->
|
||||
% ok.
|
||||
|
|
|
@ -184,7 +184,7 @@ project_app_excluded("apps/" ++ AppStr, ExcludedApps) ->
|
|||
|
||||
plugins() ->
|
||||
[
|
||||
{emqx_relup, {git, "https://github.com/emqx/emqx-relup.git", {tag, "0.1.0"}}},
|
||||
{emqx_relup, {git, "https://github.com/emqx/emqx-relup.git", {tag, "0.1.1"}}},
|
||||
%% emqx main project does not require port-compiler
|
||||
%% pin at root level for deterministic
|
||||
{pc, "v1.14.0"}
|
||||
|
|
|
@ -8,31 +8,37 @@
|
|||
%% Note that we do not support the 'apply' command in the 'code_changes' section.
|
||||
%% If any complex operations are needed during the upgrade process, please add
|
||||
%% them in the 'post_upgrade_callbacks' section, and implement them in the
|
||||
%% 'emqx_post_upgrade' module.
|
||||
%% 'emqx_post_upgrade' module. We consolidate the hot upgrade callback code into
|
||||
%% a single module ('emqx_post_upgrade') is to avoid mixing the hot upgrade-related
|
||||
%% code with the main logic code.
|
||||
|
||||
ChildSpec = fun(Mod) ->
|
||||
#{
|
||||
id => Mod,
|
||||
start => {Mod, start_link, []},
|
||||
restart => permanent,
|
||||
shutdown => 5000,
|
||||
type => worker,
|
||||
modules => [Mod]
|
||||
}
|
||||
end.
|
||||
|
||||
#{
|
||||
target_version => "5.6.1+patch.A",
|
||||
from_version => "5.6.1",
|
||||
code_changes =>
|
||||
%% the 'emqx_release' and 'emqx_post_upgrade' will be automatically added,
|
||||
%% no need to include them here
|
||||
[ {load_module, emqx_broker}
|
||||
, {load_module, emqx_metrics}
|
||||
, {load_module, emqx_persistent_message}
|
||||
, {load_module, emqx_dashboard_monitor}
|
||||
, {load_module, emqx_dashboard_monitor_api}
|
||||
, {load_module, emqx_ds_builtin_metrics}
|
||||
, {load_module, emqx_ds_storage_bitfield_lts}
|
||||
, {load_module, emqx_prometheus}
|
||||
, {load_module, emqx_ds_builtin_db_sup}
|
||||
, {load_module, emqx_ds_builtin_sup}
|
||||
, {load_module, emqx_ds_replication_layer}
|
||||
, {load_module, emqx_ds_storage_layer}
|
||||
, {load_module, emqx_broker_helper}
|
||||
, {load_module, emqx_shared_sub}
|
||||
, {load_module, emqx_ds_replication_shard_allocator}
|
||||
, {load_module, emqx_mgmt_api_metrics}
|
||||
, {update, emqx_ds_replication_layer_egress, {advanced, #{}}}
|
||||
],
|
||||
post_upgrade_callbacks =>
|
||||
[ {pr12765_update_stats_timer, pr12765_revert_stats_timer}
|
||||
[
|
||||
%% emqx_post_upgrade:pr12765_update_stats_timer/1
|
||||
pr12765_update_stats_timer,
|
||||
%% emqx_post_upgrade:pr20000_ensure_sup_started/3
|
||||
{pr20000_ensure_sup_started, ["5.6.1+patch.A", ChildSpec(some_mod)]}
|
||||
]
|
||||
}.
|
||||
|
|
Loading…
Reference in New Issue