Merge pull request #9122 from emqx/1009-fix-shared-sub-sticky-strategy-when-no-local-subs
1009 fix shared sub sticky strategy when no local subs
This commit is contained in:
commit
373bd41170
|
@ -64,6 +64,13 @@ File format:
|
||||||
This issue only occurs when unsubscribe with the session kept.
|
This issue only occurs when unsubscribe with the session kept.
|
||||||
Fixed in [#9119](https://github.com/emqx/emqx/pull/9119)
|
Fixed in [#9119](https://github.com/emqx/emqx/pull/9119)
|
||||||
|
|
||||||
|
- Fix shared subscription 'sticky' strategy when there is no local subscriptions at all.
|
||||||
|
Prior to this change, it may take a few rounds to randomly pick group members until a local subscriber
|
||||||
|
is hit (and then start sticking to it).
|
||||||
|
After this fix, it will start sticking to whichever randomly picked member even when it is a
|
||||||
|
subscriber from another node in the cluster.
|
||||||
|
Fixed in [#9122](https://github.com/emqx/emqx/pull/9122)
|
||||||
|
|
||||||
## v4.3.20
|
## v4.3.20
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
|
|
|
@ -456,6 +456,7 @@ handle_cast(Msg, State) ->
|
||||||
|
|
||||||
handle_info({mnesia_table_event, {write, NewRecord, _}}, State = #state{pmon = PMon}) ->
|
handle_info({mnesia_table_event, {write, NewRecord, _}}, State = #state{pmon = PMon}) ->
|
||||||
#emqx_shared_subscription{subpid = SubPid} = NewRecord,
|
#emqx_shared_subscription{subpid = SubPid} = NewRecord,
|
||||||
|
ok = maybe_insert_alive_tab(SubPid),
|
||||||
{noreply, update_stats(State#state{pmon = emqx_pmon:monitor(SubPid, PMon)})};
|
{noreply, update_stats(State#state{pmon = emqx_pmon:monitor(SubPid, PMon)})};
|
||||||
|
|
||||||
%% The subscriber may have subscribed multiple topics, so we need to keep monitoring the PID until
|
%% The subscriber may have subscribed multiple topics, so we need to keep monitoring the PID until
|
||||||
|
|
Loading…
Reference in New Issue