fix: run observer_web as hidden node to stop OTP global splitting IFT Mnesia cluster.
CI / test (push) Successful in 6m13s
CI / deploy-ift (push) Successful in 4m46s
CI / e2e-ift (push) Successful in 1m25s
CI / deploy-stage (push) Successful in 1m57s
CI / e2e-stage (push) Successful in 1m11s

Without --hidden, observer joins the visible mesh and prevent_overlapping_partitions disconnects eventhub-node1/2 (running_partitioned_network → admin verification-token 404 in e2e).
This commit is contained in:
2026-07-21 22:14:16 +03:00
parent 5ac23219ca
commit 9886dff8bf
2 changed files with 17 additions and 7 deletions
Regular → Executable
+4 -1
View File
@@ -39,4 +39,7 @@ COPY docker/observer_web/dev.exs ./dev.exs
EXPOSE 4000
ENV RELEASE_COOKIE=eventhub_cookie
CMD elixir --sname observer_web@observer_web --cookie "${RELEASE_COOKIE}" -S mix run --no-halt dev.exs
# --hidden: observer must not join the visible global mesh. Without it, OTP
# prevent_overlapping_partitions disconnects eventhub-node1 <-> eventhub-node2
# when observer connects to both (Mnesia running_partitioned_network → e2e 404).
CMD elixir --hidden --sname observer_web@observer_web --cookie "${RELEASE_COOKIE}" -S mix run --no-halt dev.exs
Regular → Executable
+8 -1
View File
@@ -16,14 +16,21 @@ discover_loop() ->
io:format("Checking epmd on ~s...~n", [IPStr]),
case erl_epmd:names(IP) of
{ok, List} ->
%% Only eventhub-node* — connecting to observer_web (same cookie)
%% triggers OTP prevent_overlapping_partitions and splits the mesh.
lists:foreach(fun({Name, _Port}) ->
case lists:prefix("eventhub-node", Name) of
false ->
ok;
true ->
Node = list_to_atom(Name ++ "@" ++ Name),
io:format(" Trying net_kernel:connect_node(~s)...~n", [Node]),
case net_kernel:connect_node(Node) of
true -> io:format(" *** Connected to ~s ***~n", [Node]), join_and_replicate(Node); %io:format(" *** Connected to ~s ***~n", [Node]);
true -> io:format(" *** Connected to ~s ***~n", [Node]), join_and_replicate(Node);
false -> io:format(" *** Failed to connect to ~s ***~n", [Node]);
ignored -> ok
end
end
end, List);
{error, Reason} ->
io:format(" epmd error on ~s: ~p~n", [IPStr, Reason])