浏览代码

fix(kafka): change default value for memory_overload_protection to false

Zaiming (Stone) Shi 3 年之前
父节点
当前提交
ada68e12e6

+ 5 - 0
changes/ee/fix-10007.en.md

@@ -0,0 +1,5 @@
+Change Kafka bridge's config `memory_overload_protection` default value from `true` to `false`.
+EMQX logs cases when messages get dropped due to overload protection, and this is also reflected in counters.
+However, since there is by default no alerting based on the logs and counters,
+setting it to `true` may cause messages being dropped without noticing.
+At the time being, the better option is to let sysadmin set it explicitly so they are fully aware of the benefits and risks.

+ 3 - 0
changes/ee/fix-10007.zh.md

@@ -0,0 +1,3 @@
+Kafka 桥接的配置参数 `memory_overload_protection` 默认值从 `true` 改成了 `false`。
+尽管内存过载后消息被丢弃会产生日志和计数,如果没有基于这些日志或计数的告警,系统管理员可能无法及时发现消息被丢弃。
+当前更好的选择是:让管理员显式的配置该项,迫使他们理解这个配置的好处以及风险。

+ 1 - 1
lib-ee/emqx_ee_bridge/i18n/emqx_ee_bridge_kafka.conf

@@ -439,7 +439,7 @@ emqx_ee_bridge_kafka {
     }
     }
     buffer_memory_overload_protection {
     buffer_memory_overload_protection {
         desc {
         desc {
-            en: "Applicable when buffer mode is set to <code>memory</code> or <code>hybrid</code>.\n"
+            en: "Applicable when buffer mode is set to <code>memory</code>\n"
                 "EMQX will drop old buffered messages under high memory pressure. "
                 "EMQX will drop old buffered messages under high memory pressure. "
                 "The high memory threshold is defined in config <code>sysmon.os.sysmem_high_watermark</code>. "
                 "The high memory threshold is defined in config <code>sysmon.os.sysmem_high_watermark</code>. "
                 "NOTE: This config only works on Linux."
                 "NOTE: This config only works on Linux."

+ 1 - 2
lib-ee/emqx_ee_bridge/src/emqx_ee_bridge_kafka.erl

@@ -238,8 +238,7 @@ fields(producer_buffer) ->
             )},
             )},
         {memory_overload_protection,
         {memory_overload_protection,
             mk(boolean(), #{
             mk(boolean(), #{
-                %% different from 4.x
-                default => true,
+                default => false,
                 desc => ?DESC(buffer_memory_overload_protection)
                 desc => ?DESC(buffer_memory_overload_protection)
             })}
             })}
     ].
     ].