Skip to content

Commit 0c50646

Browse files
committed
rabbit_node_monitor: Use rabbit_mnesia in partition handling-specific code
[Why] This code is specific to our use of Mnesia. It will disappear with the switch to Khepri because there will be no reliable notions of a partitioned node. We saw some regressions in the Jepsen testsuite related to partitions detection. `rabbit_nodes` introduced changes in behavior to make the `list_*` functions more consistent. But they perform some pings or RPCs which may affect the partition handling code. [How] Because this partition handling code is specific to Mnesia, we don't really need `rabbit_nodes`. Reverting calls to `rabbit_nodes` back to calls to `rabbit_mnesia` seems to improve the situation.
1 parent 865d533 commit 0c50646

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)