Coder Social home page Coder Social logo

Comments (10)

derekkraan avatar derekkraan commented on August 25, 2024 1

Thanks for your help @farhadi. I'll release an rc so that people can test a bit before I publish the final release.

from horde.

derekkraan avatar derekkraan commented on August 25, 2024 1

https://hex.pm/packages/horde/0.4.0-rc.1

from horde.

derekkraan avatar derekkraan commented on August 25, 2024

Hi Ali,

Could you try with the current Horde master branch and let me know if you're still seeing this behaviour? I have been meaning to roll a new release, as some issues such as this should be fixed.

Derek

from horde.

farhadi avatar farhadi commented on August 25, 2024

I tested with current master branch using included hello_world example.

First I start two nodes and everything is fine:

iex([email protected])1> Horde.Cluster.members(HelloWorld.HelloRegistry) 
{:ok,
 %{
   "MbAqzbUD9KNrbLIxEY+faA==" => %{
     keys_pid: #PID<0.206.0>,
     members_pid: #PID<0.198.0>,
     own_pid: #PID<0.210.0>,
     registry_pid: #PID<0.202.0>
   },
   "cg+xMC3lJCOUYmgcTI27Pw==" => %{
     keys_pid: #PID<20632.204.0>,
     members_pid: #PID<20632.196.0>,
     own_pid: #PID<20632.208.0>,
     registry_pid: #PID<20632.200.0>
   }
 }}
iex([email protected])1> Horde.Cluster.members(HelloWorld.HelloRegistry) 
{:ok,
 %{
   "MbAqzbUD9KNrbLIxEY+faA==" => %{
     keys_pid: #PID<17991.206.0>,
     members_pid: #PID<17991.198.0>,
     own_pid: #PID<17991.210.0>,
     registry_pid: #PID<17991.202.0>
   },
   "cg+xMC3lJCOUYmgcTI27Pw==" => %{
     keys_pid: #PID<0.204.0>,
     members_pid: #PID<0.196.0>,
     own_pid: #PID<0.208.0>,
     registry_pid: #PID<0.200.0>
   }
 }}

But after restarting one of the nodes, I receive this Discarding message {delta, ... error and members returns 3 items in both nodes:

iex([email protected])2> Horde.Cluster.members(HelloWorld.HelloRegistry) 
{:ok,
 %{
   "B1wfSzsxs3Py18QSzNmOfQ==" => %{
     keys_pid: #PID<20632.204.0>,
     members_pid: #PID<20632.196.0>,
     own_pid: #PID<20632.208.0>,
     registry_pid: #PID<20632.200.0>
   },
   "MbAqzbUD9KNrbLIxEY+faA==" => %{
     keys_pid: #PID<0.206.0>,
     members_pid: #PID<0.198.0>,
     own_pid: #PID<0.210.0>,
     registry_pid: #PID<0.202.0>
   },
   "cg+xMC3lJCOUYmgcTI27Pw==" => %{
     keys_pid: #PID<20632.204.0>,
     members_pid: #PID<20632.196.0>,
     own_pid: #PID<20632.208.0>,
     registry_pid: #PID<20632.200.0> 
   }
 }}
iex([email protected])2> Horde.Cluster.members(HelloWorld.HelloRegistry) 
{:ok,
 %{
   "B1wfSzsxs3Py18QSzNmOfQ==" => %{
     keys_pid: #PID<0.204.0>,
     members_pid: #PID<0.196.0>,
     own_pid: #PID<0.208.0>,
     registry_pid: #PID<0.200.0>
   },
   "MbAqzbUD9KNrbLIxEY+faA==" => %{
     keys_pid: #PID<17991.206.0>,
     members_pid: #PID<17991.198.0>,
     own_pid: #PID<17991.210.0>,
     registry_pid: #PID<17991.202.0>
   },
   "cg+xMC3lJCOUYmgcTI27Pw==" => %{
     keys_pid: #PID<0.204.0>,
     members_pid: #PID<0.196.0>,
     own_pid: #PID<0.208.0>,
     registry_pid: #PID<0.200.0>
   }
 }}

And more restarts leads to more errors and more items returned by Horde.Cluster.members

from horde.

derekkraan avatar derekkraan commented on August 25, 2024

Hi Ali,

I've done some testing, PR #57 should fix the issue. Can you please test and report back whether it works as expected?

Cheers
Derek

from horde.

farhadi avatar farhadi commented on August 25, 2024

Thanks for the quick update.
I tested with your PR and found a few issues which I tried to fix here: https://github.com/farhadi/horde/commit/dad7a2dbfae5e639e6c55ea0db0e29c9519c2288
can you take a look at my changes.

from horde.

derekkraan avatar derekkraan commented on August 25, 2024

Can you describe the issue that is fixed by this commit?

from horde.

farhadi avatar farhadi commented on August 25, 2024
  • mark_dead was defined between two clauses of handle_info
  • state.members was not defined (I used DeltaCrdt.read(state.members_pid, 30_000)) to retrieve members
  • I think mark_alive(state) was not needed here so I removed it
  • I also made mark_dead a private function

from horde.

derekkraan avatar derekkraan commented on August 25, 2024

Ah ok. I agree with all the changes except this one:

I think mark_alive(state) was not needed here so I removed it

This is needed because we also need to cover the scenario that there is a netsplit, and the node is not actually dead.

Can you restore mark_alive and open a PR on the branch remove_dead_members?

from horde.

farhadi avatar farhadi commented on August 25, 2024

Here it is: #58

from horde.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.