Skip to content

Commit

Permalink
rabbit_{mnesia,khepri}: Skip generic compat check if `CheckNodesConsi…
Browse files Browse the repository at this point in the history
…stency` is false

[Why]
`CheckNodesConsistency` is set to false when the
`check_cluster_consistency()` is called as part of a node joining a
cluster. And the generic compatibility check was already executed by
`rabbit_db_cluster`.

There is no need to run it again. This is even counter-productive with
the improvement to `rabbit_feature_flags:check_node_compatibility/2`
that follows.
  • Loading branch information
dumbbell committed Oct 19, 2023
1 parent 4c4b2d1 commit af4ef49
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions deps/rabbit/src/rabbit_khepri.erl
Original file line number Diff line number Diff line change
Expand Up @@ -753,10 +753,7 @@ check_cluster_consistency(Node, CheckNodesConsistency) ->
Error
end;
{_OTP, _Rabbit, {ok, Status}} ->
case rabbit_db_cluster:check_compatibility(Node) of
ok -> {ok, Status};
Error -> Error
end
{ok, Status}
end.

remote_node_info(Node) ->
Expand Down
5 changes: 1 addition & 4 deletions deps/rabbit/src/rabbit_mnesia.erl
Original file line number Diff line number Diff line change
Expand Up @@ -740,10 +740,7 @@ check_cluster_consistency(Node, CheckNodesConsistency) ->
Error
end;
{_OTP, _Rabbit, _Protocol, {ok, Status}} ->
case rabbit_db_cluster:check_compatibility(Node) of
ok -> {ok, Status};
Error -> Error
end
{ok, Status}
end.

remote_node_info(Node) ->
Expand Down

0 comments on commit af4ef49

Please sign in to comment.