Search code examples
elixirejabberdmnesia

ejabberd 16.03 with Elixir, node gets stuck when first node is down


I have updated to ejabberd 16.03 and set it up as an Elixir project dependency (as in: https://blog.process-one.net/how-to-use-ejabberd-as-an-elixir-application-dependency/). Then, I have setup a cluster of three nodes (node1, node2, node3), where nodes 2 and 3 run: ejabberd_cluster.join "node1".

The thing is that when I put nodes 1 and 3 down, then I down node2 and try to run node2 again, it doesn't work.

I've read: ejabberd clustering, Slave doesn't work when master goes down, but With Ejabberd 14 and Erlang, the problem didn't happened.

I know that Mnesia behaves that way but then, why it worked before the upgrade?


Solution

  • Indeed, the the expected and intended behaviour of Mnesia, as you point out is that you either have to start the node in reverse order or force master.

    Mnesia has always been working that way and behaviour did not change since the first release of ejabberd with clustering, more than 10 years ago.

    What is not correct in your case is that you stop node2 last and start node 2 first. There is no reason for it to get stuck, so you either have another issue, or your previous cluster nodes was not shutdown properly when you stopped node 2.