Skip to content

Commit 22516aa

Browse files
committed
rabbit_node_monitor: Use rabbit_mnesia in partition handling-specific code
[Why] The partition detection code defines a partitioned node as an Erlang node running RabbitMQ but which is not among the Mnesia running nodes. Since #7058, `rabbit_node_monitor` uses the list functions exported by `rabbit_nodes` for everything, except the partition detection code which is Mnesia-specific and relies on `rabbit_mnesia:cluster_nodes/1`. Unfortunately, we saw regressions in the Jepsen testsuite during the 3.12.0 release cycle only because that testsuite is not executed on `main`. It happens that the partition detection code is using `rabbit_nodes` list functions in two places where it should have continued to use `rabbit_mnesia`. [How] The fix bug fix simply consists of reverting the two calls to `rabbit_nodes` back to calls to `rabbit_mnesia` as it used to do. This seems to improve the situation a lot in the manual testing. This code will go away with our use of Mnesia in the future, so it's not a problem to call `rabbit_mnesia` here.
1 parent b694cd1 commit 22516aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

deps/rabbit/src/rabbit_node_monitor.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ handle_cast({announce_guid, Node, GUID}, State = #state{node_guids = GUIDs}) ->
470470
handle_cast({check_partial_partition, Node, Rep, NodeGUID, MyGUID, RepGUID},
471471
State = #state{guid = MyGUID,
472472
node_guids = GUIDs}) ->
473-
case lists:member(Node, rabbit_nodes:list_reachable()) andalso
473+
case lists:member(Node, rabbit_mnesia:cluster_nodes(running)) andalso
474474
maps:find(Node, GUIDs) =:= {ok, NodeGUID} of
475475
true -> spawn_link( %%[1]
476476
fun () ->
@@ -623,7 +623,7 @@ handle_info({nodedown, Node, Info}, State = #state{guid = MyGUID,
623623
Node, node(), DownGUID, CheckGUID, MyGUID})
624624
end,
625625
_ = case maps:find(Node, GUIDs) of
626-
{ok, DownGUID} -> Alive = rabbit_nodes:list_reachable()
626+
{ok, DownGUID} -> Alive = rabbit_mnesia:cluster_nodes(running)
627627
-- [node(), Node],
628628
[case maps:find(N, GUIDs) of
629629
{ok, CheckGUID} -> Check(N, CheckGUID, DownGUID);

0 commit comments

Comments
 (0)