bitwalker / libcluster

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

:erpc.multicast/4 not working with Cluster.Strategy.Gossip strategy #188

Closed spencerdcarlson closed 1 year ago

spencerdcarlson commented 1 year ago

Steps to reproduce

config :slab, MyApp.Cache, local_opts: [], levels: [ {MyApp.Cache.Partitioned, []}, ]


```elixir
defmodule MyApp.Cache do
  use Nebulex.Cache,
    otp_app: :slab,
    adapter: NebulexLocalMultilevelAdapter
end

defmodule MyApp.Cache.Partitioned do
  use Nebulex.Cache,
    otp_app: :slab,
    adapter: Nebulex.Adapters.Partitioned
end

Description of issue

I think :erpc.multicast/4 might not be working with Cluster.Strategy.Gossip strategy. While using NebulexLocalMultilevelAdapter with the Partitioned adapter as my L2 I can see my Nodes clustered by printing out Node.list() but the Nebulex call to :erpc.multicast/4 doesn't seem to be working. If I switch to using a Elixir.Cluster.Strategy.LocalEpmd topology, everything seems to be working as expected.

spencerdcarlson commented 1 year ago

🤔 I am not sure if this is related to libcluster. I modified nebulex_local_multilevel_adapter.ex#L202 locally to use :erpc.multicall/4 and it seems to work correctly returning appropriately and syncing the Nebulex cache on each node.