diff --git a/apps/emqx/rebar.config b/apps/emqx/rebar.config index 27648a88d..98a2d36fa 100644 --- a/apps/emqx/rebar.config +++ b/apps/emqx/rebar.config @@ -28,7 +28,7 @@ {gproc, {git, "https://github.com/emqx/gproc", {tag, "0.9.0.1"}}}, {cowboy, {git, "https://github.com/emqx/cowboy", {tag, "2.9.2"}}}, {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.11.2"}}}, - {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.19.3"}}}, + {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.19.4"}}}, {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "3.3.1"}}}, {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.42.2"}}}, {emqx_http_lib, {git, "https://github.com/emqx/emqx_http_lib.git", {tag, "0.5.3"}}}, diff --git a/apps/emqx/src/emqx_schema.erl b/apps/emqx/src/emqx_schema.erl index e3b0acaf1..8680166d7 100644 --- a/apps/emqx/src/emqx_schema.erl +++ b/apps/emqx/src/emqx_schema.erl @@ -1954,10 +1954,6 @@ zones_field_schema() -> } ). -desc("persistent_session_store") -> - "Settings for message persistence."; -desc("persistent_session_builtin") -> - "Settings for the built-in storage engine of persistent messages."; desc("persistent_table_mria_opts") -> "Tuning options for the mria table."; desc("stats") -> diff --git a/apps/emqx_conf/src/emqx_conf_schema.erl b/apps/emqx_conf/src/emqx_conf_schema.erl index 2c0de10aa..e3e888cd6 100644 --- a/apps/emqx_conf/src/emqx_conf_schema.erl +++ b/apps/emqx_conf/src/emqx_conf_schema.erl @@ -134,10 +134,27 @@ roots() -> lists:flatmap(fun roots/1, common_apps()). validations() -> - [{check_node_name_and_discovery_strategy, fun validate_cluster_strategy/1}] ++ + [ + {check_node_name_and_discovery_strategy, fun validate_cluster_strategy/1}, + {validate_durable_sessions_strategy, fun validate_durable_sessions_strategy/1} + ] ++ hocon_schema:validations(emqx_schema) ++ lists:flatmap(fun hocon_schema:validations/1, common_apps()). +validate_durable_sessions_strategy(Conf) -> + DSEnabled = hocon_maps:get("durable_sessions.enable", Conf), + DiscoveryStrategy = hocon_maps:get("cluster.discovery_strategy", Conf), + DSBackend = hocon_maps:get("durable_storage.messages.backend", Conf), + case {DSEnabled, DSBackend} of + {true, builtin_local} when DiscoveryStrategy =/= singleton -> + {error, << + "cluster discovery strategy must be 'singleton' when" + " durable storage backend is 'builtin_local'" + >>}; + _ -> + ok + end. + common_apps() -> Edition = emqx_release:edition(), lists:filtermap( @@ -166,7 +183,7 @@ fields("cluster") -> )}, {"discovery_strategy", sc( - hoconsc:enum([manual, static, dns, etcd, k8s]), + hoconsc:enum([manual, static, singleton, dns, etcd, k8s]), #{ default => manual, desc => ?DESC(cluster_discovery_strategy), diff --git a/changes/ce/feat-13250.en.md b/changes/ce/feat-13250.en.md new file mode 100644 index 000000000..9b42ad579 --- /dev/null +++ b/changes/ce/feat-13250.en.md @@ -0,0 +1 @@ +Added a new `cluster.discovery_strategy` value: `singleton`. By choosing this option, there will be effectively no clustering, and the node will reject connection attempts to and from other nodes. diff --git a/mix.exs b/mix.exs index eb2bda31f..df25942dd 100644 --- a/mix.exs +++ b/mix.exs @@ -55,7 +55,7 @@ defmodule EMQXUmbrella.MixProject do {:cowboy, github: "emqx/cowboy", tag: "2.9.2", override: true}, {:esockd, github: "emqx/esockd", tag: "5.11.2", override: true}, {:rocksdb, github: "emqx/erlang-rocksdb", tag: "1.8.0-emqx-5", override: true}, - {:ekka, github: "emqx/ekka", tag: "0.19.3", override: true}, + {:ekka, github: "emqx/ekka", tag: "0.19.4", override: true}, {:gen_rpc, github: "emqx/gen_rpc", tag: "3.3.1", override: true}, {:grpc, github: "emqx/grpc-erl", tag: "0.6.12", override: true}, {:minirest, github: "emqx/minirest", tag: "1.4.1", override: true}, diff --git a/rebar.config b/rebar.config index 51a7ed17c..4190ef7f0 100644 --- a/rebar.config +++ b/rebar.config @@ -83,7 +83,7 @@ {cowboy, {git, "https://github.com/emqx/cowboy", {tag, "2.9.2"}}}, {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.11.2"}}}, {rocksdb, {git, "https://github.com/emqx/erlang-rocksdb", {tag, "1.8.0-emqx-5"}}}, - {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.19.3"}}}, + {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.19.4"}}}, {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "3.3.1"}}}, {grpc, {git, "https://github.com/emqx/grpc-erl", {tag, "0.6.12"}}}, {minirest, {git, "https://github.com/emqx/minirest", {tag, "1.4.1"}}},