bitwalker / libcluster

Automatic cluster formation/healing for Elixir applications
MIT License
1.98k stars 188 forks source link

After the node disconnected by libcluster, it went back again to the Topology! #202

Open wawashra opened 3 months ago

wawashra commented 3 months ago

Steps to reproduce

Description of issue

When I scaled down the deployment, I supposed the libclutser should disconnect the node when the k8s pod starts to terminate, but after the node was disconnected, it went back again to the cluster! and be visible and I can see it by Node.list() until the be pod is fully terminated!.

What are the expected results?

When the Node is not a part of the Topology(For example K8S service discovery), it should not be reconnected to the other nodes

Suggested Solution & Discussion .

To address that, I cloned the original Strategy (Cluster.Strategy.Kubernetes.DNS), And I patched it by adding a validation during the connection process, by validating the source node needed to connect to the other nodes must be a member of the topology(In my case it is must be one of the nodes back from the nslookup discovery), is that a correct solution? can we collaborate to make a general fix to be fit with the libcluster core?