Bläddra i källkod

chore(config): rename cluster_call to hot_config_loader

zhongwencool 4 år sedan
förälder
incheckning
2c1b1fbfa8

+ 2 - 0
apps/emqx/etc/emqx.conf

@@ -222,6 +222,8 @@ listeners.quic.default {
   ## If not set, the global configs are used for this listener.
   ## If not set, the global configs are used for this listener.
   ##
   ##
   ## See `zones.<name>` for more details.
   ## See `zones.<name>` for more details.
+  ## NOTE: This is a cluster-wide configuration.
+  ## It requires all nodes to be stopped before changing it.
   ##
   ##
   ## @doc listeners.quic.<name>.zone
   ## @doc listeners.quic.<name>.zone
   ## ValueType: String
   ## ValueType: String

+ 1 - 1
apps/emqx/src/emqx_cluster_rpc.erl

@@ -64,7 +64,7 @@ mnesia(copy) ->
     ok = ekka_mnesia:copy_table(cluster_rpc_commit, disc_copies).
     ok = ekka_mnesia:copy_table(cluster_rpc_commit, disc_copies).
 
 
 start_link() ->
 start_link() ->
-    RetryMs = emqx:get_config([broker, cluster_call, retry_interval]),
+    RetryMs = emqx:get_config([broker, hot_config_loader, retry_interval]),
     start_link(node(), ?MODULE, RetryMs).
     start_link(node(), ?MODULE, RetryMs).
 start_link(Node, Name, RetryMs) ->
 start_link(Node, Name, RetryMs) ->
     gen_statem:start_link({local, Name}, ?MODULE, [Node, RetryMs], []).
     gen_statem:start_link({local, Name}, ?MODULE, [Node, RetryMs], []).

+ 2 - 2
apps/emqx/src/emqx_cluster_rpc_handler.erl

@@ -28,8 +28,8 @@
 -define(MFA_HISTORY_LEN, 100).
 -define(MFA_HISTORY_LEN, 100).
 
 
 start_link() ->
 start_link() ->
-    MaxHistory = emqx:get_config([broker, cluster_call, mfa_max_history]),
-    CleanupMs = emqx:get_config([broker, cluster_call, mfa_cleanup_interval]),
+    MaxHistory = emqx:get_config([broker, hot_config_loader, mfa_max_history]),
+    CleanupMs = emqx:get_config([broker, hot_config_loader, mfa_cleanup_interval]),
     start_link(MaxHistory, CleanupMs).
     start_link(MaxHistory, CleanupMs).
 
 
 start_link(MaxHistory, CleanupMs) ->
 start_link(MaxHistory, CleanupMs) ->

+ 3 - 3
apps/emqx/src/emqx_schema.erl

@@ -293,7 +293,7 @@ fields("broker") ->
     , {"shared_dispatch_ack_enabled", t(boolean(), undefined, false)}
     , {"shared_dispatch_ack_enabled", t(boolean(), undefined, false)}
     , {"route_batch_clean", t(boolean(), undefined, true)}
     , {"route_batch_clean", t(boolean(), undefined, true)}
     , {"perf", ref("perf")}
     , {"perf", ref("perf")}
-    , {"cluster_call", ref("cluster_call")}
+    , {"hot_config_loader", ref("hot_config_loader")}
     ];
     ];
 
 
 fields("perf") ->
 fields("perf") ->
@@ -326,8 +326,8 @@ fields("sysmon_os") ->
     , {"procmem_high_watermark", t(percent(), undefined, "5%")}
     , {"procmem_high_watermark", t(percent(), undefined, "5%")}
     ];
     ];
 
 
-fields("cluster_call") ->
-    [{"retry_interval", t(duration(), undefined, "2s")}
+fields("hot_config_loader") ->
+    [{"retry_interval", t(duration(), undefined, "1s")}
     , {"mfa_max_history", t(range(1, 500), undefined, 50)}
     , {"mfa_max_history", t(range(1, 500), undefined, 50)}
     , {"mfa_cleanup_interval", t(duration(), undefined, "5m")}
     , {"mfa_cleanup_interval", t(duration(), undefined, "5m")}
     ];
     ];

+ 1 - 1
apps/emqx/test/emqx_cluster_rpc_SUITE.erl

@@ -41,7 +41,7 @@ init_per_suite(Config) ->
     application:load(emqx),
     application:load(emqx),
     ok = ekka:start(),
     ok = ekka:start(),
     emqx_cluster_rpc:mnesia(copy),
     emqx_cluster_rpc:mnesia(copy),
-    emqx_config:put([broker, cluster_call], #{
+    emqx_config:put([broker, hot_config_loader], #{
         mfa_max_history => 100,
         mfa_max_history => 100,
         mfa_cleanup_interval => 1000,
         mfa_cleanup_interval => 1000,
         retry_interval => 900
         retry_interval => 900