Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only copy local listeners when FF listener_records_in_ets is enabled #8984

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion deps/rabbit/src/rabbit_core_ff.erl
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ listener_records_in_ets_enable(#{feature_name := FeatureName}) ->
rabbit_listener, [{'$1',[],['$1']}]),
lists:foreach(
fun(Listener) ->
ets:insert(rabbit_listener_ets, Listener)
rabbit_networking:is_listener_on_this_node(Listener)
andalso ets:insert(rabbit_listener_ets, Listener)
end, Listeners)
end)
catch
Expand Down
6 changes: 6 additions & 0 deletions deps/rabbit/src/rabbit_networking.erl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@

-export([ensure_listener_table_for_this_node/0]).

-export([is_listener_on_this_node/1]).

-deprecated([{force_connection_event_refresh, 1, eventually}]).

-export([
Expand Down Expand Up @@ -819,3 +821,7 @@ ipv6_status(TestPort) ->
ensure_listener_table_for_this_node() ->
_ = ets:new(?ETS_TABLE, [named_table, public, bag, {keypos, #listener.node}]),
ok.

%% Needed for migration when feature flag listener_records_in_ets is enabled
is_listener_on_this_node(#listener{node = Node}) ->
Node =:= node().