|
2 | 2 | %% License, v. 2.0. If a copy of the MPL was not distributed with this |
3 | 3 | %% file, You can obtain one at https://mozilla.org/MPL/2.0/. |
4 | 4 | %% |
5 | | -%% Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. All rights reserved. |
| 5 | +%% Copyright (c) 2023-2025 Broadcom. All Rights Reserved. The term “Broadcom” |
| 6 | +%% refers to Broadcom Inc. and/or its subsidiaries. All rights reserved. |
6 | 7 | %% |
7 | 8 |
|
8 | 9 | -module(rabbit_db_cluster). |
@@ -50,7 +51,8 @@ ensure_feature_flags_are_in_sync(Nodes, NodeIsVirgin) -> |
50 | 51 | RemoteNode :: node(), |
51 | 52 | Ret :: Ok | Error, |
52 | 53 | Ok :: {ok, [node()]} | {ok, already_member}, |
53 | | - Error :: {error, {inconsistent_cluster, string()} | {error, {erpc, noconnection}}}. |
| 54 | + Error :: {error, {inconsistent_cluster, string()} | |
| 55 | + {error, {erpc, noconnection}}}. |
54 | 56 |
|
55 | 57 | can_join(RemoteNode) -> |
56 | 58 | ?LOG_INFO( |
@@ -82,7 +84,8 @@ can_join_using_khepri(RemoteNode) -> |
82 | 84 | NodeType :: node_type(), |
83 | 85 | Ret :: Ok | Error, |
84 | 86 | Ok :: ok | {ok, already_member}, |
85 | | - Error :: {error, {inconsistent_cluster, string()} | {error, {erpc, noconnection}}}. |
| 87 | + Error :: {error, {inconsistent_cluster, string()} | |
| 88 | + {error, {erpc, noconnection}}}. |
86 | 89 | %% @doc Adds this node to a cluster using `RemoteNode' to reach it. |
87 | 90 |
|
88 | 91 | join(ThisNode, _NodeType) when ThisNode =:= node() -> |
@@ -219,15 +222,18 @@ join(RemoteNode, NodeType) |
219 | 222 | true -> |
220 | 223 | Error; |
221 | 224 | false -> |
222 | | - %% rabbit_mnesia:can_join_cluster/1 notice inconsistent_cluster, |
223 | | - %% as RemoteNode thinks this node is already in the cluster. |
224 | | - %% Attempt to leave the RemoteNode cluster, the discovery cluster, |
225 | | - %% and simply retry the operation. |
226 | | - ?LOG_INFO("Mnesia: node ~tp thinks it's clustered " |
227 | | - "with node ~tp, but ~tp disagrees. ~tp will ask " |
228 | | - "to leave the cluster and try again.", |
229 | | - [RemoteNode, node(), node(), node()]), |
230 | | - ok = rabbit_mnesia:leave_then_rediscover_cluster(RemoteNode), |
| 225 | + %% rabbit_mnesia:can_join_cluster/1 notice |
| 226 | + %% inconsistent_cluster, as RemoteNode thinks this node is |
| 227 | + %% already in the cluster. Attempt to leave the RemoteNode |
| 228 | + %% cluster, the discovery cluster, and simply retry the |
| 229 | + %% operation. |
| 230 | + ?LOG_INFO( |
| 231 | + "Mnesia: node ~tp thinks it's clustered " |
| 232 | + "with node ~tp, but ~tp disagrees. ~tp will ask " |
| 233 | + "to leave the cluster and try again.", |
| 234 | + [RemoteNode, node(), node(), node()]), |
| 235 | + ok = rabbit_mnesia:leave_then_rediscover_cluster( |
| 236 | + RemoteNode), |
231 | 237 | join(RemoteNode, NodeType) |
232 | 238 | end; |
233 | 239 | {error, _} = Error -> |
|
0 commit comments