Merge pull request #10462 from zmstone/0430-EMQX-8434-shared-dispatch-ack-deprecated

chore: Hide config shared_dispatch_ack_enabled
This commit is contained in:
Zaiming (Stone) Shi 2023-04-24 09:42:09 +02:00 committed by GitHub
commit 366aa53c80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 12 deletions

View File

@ -1489,10 +1489,8 @@ fields("broker") ->
sc( sc(
boolean(), boolean(),
#{ #{
%% TODO: deprecated => {since, "5.1.0"} deprecated => {since, "5.1.0"},
%% in favor of session message re-dispatch at termination importance => ?IMPORTANCE_HIDDEN,
%% we will stop supporting dispatch acks for shared
%% subscriptions.
default => false, default => false,
desc => ?DESC(broker_shared_dispatch_ack_enabled) desc => ?DESC(broker_shared_dispatch_ack_enabled)
} }

View File

@ -165,7 +165,7 @@ strategy(Group) ->
-spec ack_enabled() -> boolean(). -spec ack_enabled() -> boolean().
ack_enabled() -> ack_enabled() ->
emqx:get_config([broker, shared_dispatch_ack_enabled]). emqx:get_config([broker, shared_dispatch_ack_enabled], false).
do_dispatch(SubPid, _Group, Topic, Msg, _Type) when SubPid =:= self() -> do_dispatch(SubPid, _Group, Topic, Msg, _Type) when SubPid =:= self() ->
%% Deadlock otherwise %% Deadlock otherwise
@ -181,7 +181,7 @@ do_dispatch(SubPid, _Group, Topic, Msg, retry) ->
do_dispatch(SubPid, Group, Topic, Msg, fresh) -> do_dispatch(SubPid, Group, Topic, Msg, fresh) ->
case ack_enabled() of case ack_enabled() of
true -> true ->
%% FIXME: replace with `emqx_shared_sub_proto:dispatch_with_ack' in 5.2 %% TODO: delete this clase after 5.1.0
do_dispatch_with_ack(SubPid, Group, Topic, Msg); do_dispatch_with_ack(SubPid, Group, Topic, Msg);
false -> false ->
send(SubPid, Topic, {deliver, Topic, Msg}) send(SubPid, Topic, {deliver, Topic, Msg})

View File

@ -50,7 +50,6 @@ t_fill_default_values(_) ->
}, },
<<"route_batch_clean">> := false, <<"route_batch_clean">> := false,
<<"session_locking_strategy">> := quorum, <<"session_locking_strategy">> := quorum,
<<"shared_dispatch_ack_enabled">> := false,
<<"shared_subscription_strategy">> := round_robin <<"shared_subscription_strategy">> := round_robin
} }
}, },

View File

@ -0,0 +1,4 @@
Deprecate config `broker.shared_dispatch_ack_enabled`.
This was designed to avoid dispatching messages to a shared-subscription session which has the client disconnected.
However since v5.0.9, this feature is no longer useful because the shared-subscrption messages in a expired session will be redispatched to other sessions in the group.
See also: https://github.com/emqx/emqx/pull/9104

View File

@ -1373,9 +1373,9 @@ persistent_session_store_message_gc_interval.label:
"""Message GC interval""" """Message GC interval"""
broker_shared_dispatch_ack_enabled.desc: broker_shared_dispatch_ack_enabled.desc:
"""Deprecated, will be removed in 5.1. """Deprecated.
Enable/disable shared dispatch acknowledgement for QoS 1 and QoS 2 messages. This was designed to avoid dispatching messages to a shared-subscription session which has the client disconnected.
This should allow messages to be dispatched to a different subscriber in the group in case the picked (based on `shared_subscription_strategy`) subscriber is offline.""" However it's no longer useful because the shared-subscrption messages in a expired session will be redispatched to other sessions in the group."""
base_listener_enable_authn.desc: base_listener_enable_authn.desc:
"""Set <code>true</code> (default) to enable client authentication on this listener, the authentication """Set <code>true</code> (default) to enable client authentication on this listener, the authentication

View File

@ -1313,9 +1313,10 @@ persistent_session_store_message_gc_interval.label:
"""消息清理间隔""" """消息清理间隔"""
broker_shared_dispatch_ack_enabled.desc: broker_shared_dispatch_ack_enabled.desc:
"""该配置项已废弃,会在 5.1 中移除 """该配置项已废弃。
启用/禁用 QoS 1 和 QoS 2 消息的共享派发确认。 启用/禁用 QoS 1 和 QoS 2 消息的共享派发确认。
开启后,允许将消息从未及时回复 ACK 的订阅者 (例如,客户端离线) 重新派发给另外一个订阅者。""" 该配置最初设计用于避免将消息派发给客户端离线状态下的会话中去。
但新版本中,已做增强:在一个会话结束时,会话中的消息会重新派发到组内的其他会话中 -- 使这个老配置失去存在的意义。"""
base_listener_enable_authn.desc: base_listener_enable_authn.desc:
"""配置 <code>true</code> (默认值)启用客户端进行身份认证,通过检查认配置的认认证器链来决定是否允许接入。 """配置 <code>true</code> (默认值)启用客户端进行身份认证,通过检查认配置的认认证器链来决定是否允许接入。