From fb140a124647076cf9cff2083e8a5191f501d0df Mon Sep 17 00:00:00 2001 From: Kinplemelon Date: Mon, 8 Jan 2024 16:48:56 +0800 Subject: [PATCH 1/3] chore: upgrade dashboard to v1.6.1 for ce --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8afe7bd81..22b40ee85 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ endif # Dashboard version # from https://github.com/emqx/emqx-dashboard5 -export EMQX_DASHBOARD_VERSION ?= v1.6.0 +export EMQX_DASHBOARD_VERSION ?= v1.6.1 export EMQX_EE_DASHBOARD_VERSION ?= e1.4.1 PROFILE ?= emqx From caf461fdf633eb667a4e6165c8a73d0a8a98a808 Mon Sep 17 00:00:00 2001 From: ieQu1 <99872536+ieQu1@users.noreply.github.com> Date: Mon, 8 Jan 2024 17:19:32 +0100 Subject: [PATCH 2/3] fix(ds): Don't start the supervision tree when feature is not in use --- .../src/emqx_ds_replication_layer.erl | 3 +- apps/emqx_durable_storage/src/emqx_ds_sup.erl | 38 ++++++++++++++----- .../src/emqx_durable_storage.app.src | 2 +- .../emqx_ds_storage_bitfield_lts_SUITE.erl | 3 +- 4 files changed, 34 insertions(+), 12 deletions(-) diff --git a/apps/emqx_durable_storage/src/emqx_ds_replication_layer.erl b/apps/emqx_durable_storage/src/emqx_ds_replication_layer.erl index a9d904da1..ab72eb7f3 100644 --- a/apps/emqx_durable_storage/src/emqx_ds_replication_layer.erl +++ b/apps/emqx_durable_storage/src/emqx_ds_replication_layer.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2023 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2023-2024 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -109,6 +109,7 @@ list_shards(DB) -> -spec open_db(emqx_ds:db(), builtin_db_opts()) -> ok | {error, _}. open_db(DB, CreateOpts) -> + ok = emqx_ds_sup:ensure_workers(), Opts = emqx_ds_replication_layer_meta:open_db(DB, CreateOpts), MyShards = emqx_ds_replication_layer_meta:my_shards(DB), lists:foreach( diff --git a/apps/emqx_durable_storage/src/emqx_ds_sup.erl b/apps/emqx_durable_storage/src/emqx_ds_sup.erl index 081557a46..819d7d874 100644 --- a/apps/emqx_durable_storage/src/emqx_ds_sup.erl +++ b/apps/emqx_durable_storage/src/emqx_ds_sup.erl @@ -1,12 +1,12 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2022-2023 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2022-2024 EMQ Technologies Co., Ltd. All Rights Reserved. %%-------------------------------------------------------------------- -module(emqx_ds_sup). -behaviour(supervisor). %% API: --export([start_link/0]). +-export([start_link/0, ensure_workers/0]). %% behaviour callbacks: -export([init/1]). @@ -23,21 +23,41 @@ -spec start_link() -> {ok, pid()}. start_link() -> - supervisor:start_link({local, ?SUP}, ?MODULE, []). + supervisor:start_link({local, ?SUP}, ?MODULE, top). + +-spec ensure_workers() -> ok. +ensure_workers() -> + ChildSpec = #{ + id => workers_sup, + restart => temporary, + type => supervisor, + start => {supervisor, start_link, [?MODULE, workers]} + }, + case supervisor:start_child(?SUP, ChildSpec) of + {ok, _} -> + ok; + {error, already_present} -> + ok; + {error, {already_started, _}} -> + ok + end. %%================================================================================ %% behaviour callbacks %%================================================================================ -dialyzer({nowarn_function, init/1}). -init([]) -> +init(top) -> + SupFlags = #{ + strategy => one_for_all, + intensity => 10, + period => 1 + }, + {ok, {SupFlags, []}}; +init(workers) -> %% TODO: technically, we don't need rocksDB for the alternative %% backends. But right now we have any: - Children = - case mria:rocksdb_backend_available() of - true -> [meta(), storage_layer_sup()]; - false -> [] - end, + Children = [meta(), storage_layer_sup()], SupFlags = #{ strategy => one_for_all, intensity => 0, diff --git a/apps/emqx_durable_storage/src/emqx_durable_storage.app.src b/apps/emqx_durable_storage/src/emqx_durable_storage.app.src index fd2c56293..f6f757cfd 100644 --- a/apps/emqx_durable_storage/src/emqx_durable_storage.app.src +++ b/apps/emqx_durable_storage/src/emqx_durable_storage.app.src @@ -2,7 +2,7 @@ {application, emqx_durable_storage, [ {description, "Message persistence and subscription replays for EMQX"}, % strict semver, bump manually! - {vsn, "0.1.9"}, + {vsn, "0.1.10"}, {modules, []}, {registered, []}, {applications, [kernel, stdlib, rocksdb, gproc, mria, emqx_utils]}, diff --git a/apps/emqx_durable_storage/test/emqx_ds_storage_bitfield_lts_SUITE.erl b/apps/emqx_durable_storage/test/emqx_ds_storage_bitfield_lts_SUITE.erl index 7b733406d..22fad903e 100644 --- a/apps/emqx_durable_storage/test/emqx_ds_storage_bitfield_lts_SUITE.erl +++ b/apps/emqx_durable_storage/test/emqx_ds_storage_bitfield_lts_SUITE.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2022-2023 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2022-2024 EMQ Technologies Co., Ltd. All Rights Reserved. %%-------------------------------------------------------------------- -module(emqx_ds_storage_bitfield_lts_SUITE). @@ -378,6 +378,7 @@ suite() -> [{timetrap, {seconds, 20}}]. init_per_suite(Config) -> {ok, _} = application:ensure_all_started(emqx_durable_storage), + emqx_ds_sup:ensure_workers(), Config. end_per_suite(_Config) -> From 63f6fa85842ac02565083bd9c2c516c77c97fd94 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Mon, 8 Jan 2024 20:43:58 +0100 Subject: [PATCH 3/3] docs: add changelog for PR 12264 --- changes/e5.4.1.en.md | 2 ++ changes/v5.4.1.en.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/changes/e5.4.1.en.md b/changes/e5.4.1.en.md index c41ff0a55..1ba1c3e0b 100644 --- a/changes/e5.4.1.en.md +++ b/changes/e5.4.1.en.md @@ -19,3 +19,5 @@ - [#12250](https://github.com/emqx/emqx/pull/12250) Resolved an issue where the `file_transfer` configuration's `secret_access_key` value was erroneously being updated to masked stars (`*****`), ensuring that the original key value remains unaltered and secure. - [#12256](https://github.com/emqx/emqx/pull/12256) Fixed an issue that prevented establishing connections to MySQL resources without a password. + +- [#12264](https://github.com/emqx/emqx/pull/12264) Fix rolling upgrade when replica nodes join cluster with core nodes prior to version 5.4. diff --git a/changes/v5.4.1.en.md b/changes/v5.4.1.en.md index beb4c822a..837498fd8 100644 --- a/changes/v5.4.1.en.md +++ b/changes/v5.4.1.en.md @@ -11,3 +11,5 @@ - [#12246](https://github.com/emqx/emqx/pull/12246) Stopped exposing port 11883 by default in Docker and removed it from Helm charts, as this port is no longer in use. - [#12249](https://github.com/emqx/emqx/pull/12249) Fixed an issue in the `/configs` API where attempting to modify a read-only configuration value resulted in a garbled response message. + +- [#12264](https://github.com/emqx/emqx/pull/12264) Fix rolling upgrade when replica nodes join cluster with core nodes prior to version 5.4.