Giter Club home page Giter Club logo

bullysharp's Introduction

davidhagg

Welcome

bullysharp's People

Contributors

davidhagg avatar

Watchers

 avatar

bullysharp's Issues

Step missing from the algo?

Could it be that you missed the step

If P receives an Election message from another process with a lower ID it sends an Answer message back and starts the election process at the beginning, by sending an Election message to higher-numbered processes.

in your implementation? I was wondering why at times when process 0 was going through the election and then elected a leader, and at the same time I was starting up process 1, process 1 might get a victory message from 0 and thus declare the leader is 0. And then both would go on pinging each other and merrily keep that state.

Your MessageListener doesn't have the capability to determine the process id of the sender of an election, and there's nothing in there retriggering an election should an election message be received from a peer with a lower Id.

Also, I was wondering, what's the reason for the 2 second delay between starting the MessageListener and the LeaderElection - is that a safety buffer to work around the problem I mentioned above ?

I went ahead and implemented that missing step. Plus I was occasionally getting the wrong leader when the process with the lower id was in the middle of the election when the process with the higher id started. So as a safety, when I get an election from a lower process, I retrigger the election which corrects the state.

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.