diff options
author | Jean-Sébastien Pédron <jean-sebastien.pedron@dumbbell.fr> | 2023-03-21 12:41:52 +0100 |
---|---|---|
committer | Jean-Sébastien Pédron <jean-sebastien.pedron@dumbbell.fr> | 2023-03-21 15:48:39 +0100 |
commit | 22516aad2f32488910a4410356f67847c243c9fe (patch) | |
tree | c7aeeb8fe7c777eb7ae43f6829521064a7ce30e3 | |
parent | b694cd1a5a0e825642565ad8a6beb4e9fa181e19 (diff) | |
download | rabbitmq-server-git-22516aad2f32488910a4410356f67847c243c9fe.tar.gz |
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.
-rw-r--r-- | deps/rabbit/src/rabbit_node_monitor.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/deps/rabbit/src/rabbit_node_monitor.erl b/deps/rabbit/src/rabbit_node_monitor.erl index d469830c9b..dff0e97509 100644 --- a/deps/rabbit/src/rabbit_node_monitor.erl +++ b/deps/rabbit/src/rabbit_node_monitor.erl @@ -470,7 +470,7 @@ handle_cast({announce_guid, Node, GUID}, State = #state{node_guids = GUIDs}) -> handle_cast({check_partial_partition, Node, Rep, NodeGUID, MyGUID, RepGUID}, State = #state{guid = MyGUID, node_guids = GUIDs}) -> - case lists:member(Node, rabbit_nodes:list_reachable()) andalso + case lists:member(Node, rabbit_mnesia:cluster_nodes(running)) andalso maps:find(Node, GUIDs) =:= {ok, NodeGUID} of true -> spawn_link( %%[1] fun () -> @@ -623,7 +623,7 @@ handle_info({nodedown, Node, Info}, State = #state{guid = MyGUID, Node, node(), DownGUID, CheckGUID, MyGUID}) end, _ = case maps:find(Node, GUIDs) of - {ok, DownGUID} -> Alive = rabbit_nodes:list_reachable() + {ok, DownGUID} -> Alive = rabbit_mnesia:cluster_nodes(running) -- [node(), Node], [case maps:find(N, GUIDs) of {ok, CheckGUID} -> Check(N, CheckGUID, DownGUID); |