Giter VIP home page Giter VIP logo

Comments (5)

belaban avatar belaban commented on May 28, 2024

Hi Jordan,
sorry for the delay, just returned from NYC and will be away for the better part of the next 2 weeks, too.
I'll get to this eventually (no pun intended :-))

from jgroups-raft.

kuujo avatar kuujo commented on May 28, 2024

:-P no rush was just poking around and noticed it. Thought I'd point it out in case I was reading it right.

from jgroups-raft.

pandaworrior avatar pandaworrior commented on May 28, 2024

Hi Jordan,

There are two timers, heartbeat timer and election timer. As you mentioned,
the election timer must be reset when every time the election starts, in
order to avoid split vote. But, there is no need to reset the heartbeat
timer.

Thanks,
Cheng

On Fri, Mar 25, 2016 at 2:52 PM, Jordan Halterman [email protected]
wrote:

I may be missing something, so apologies if I'm reading your code wrong
:-)
It appears that when handling a VoteRequest, the heartbeat timer is never
reset upon voting for a candidate.

https://github.com/belaban/jgroups-raft/blob/master/src/org/jgroups/protocols/raft/ELECTION.java#L191-L211
Raft specifies that a follower resets its election timeout when it grants
a vote to a candidate. This ensures that a follower doesn't vote for a
candidate and then immediately timeout, transition to candidate itself,
increment its term, vote for itself, and ultimately force a newly elected
leader to step down.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#45

Best wishes!

             Sincerely,

ChengLi,
Ph.D Candidate Student,
Max Planck Institute for Software System,
Campus E 1 4,
D-66123 Saarbruecken,
Germany

from jgroups-raft.

belaban avatar belaban commented on May 28, 2024

In [1], I completely redesigned the way elections work; an election is now triggered and controlled by the JGroups coordinator. This means that election and heartbeat timers are gone; the coord solicits votes from everyone when an election is required and elects a leader based on majority/last-term/longest-index (if all are equal, then rank-based).

While this eliminates concurrent elections, the election outcome should still be correct.

[1] #20
[1] https://github.com/belaban/jgroups-raft/blob/master/doc/design/Election.txt

from jgroups-raft.

belaban avatar belaban commented on May 28, 2024

@kuujo @pandaworrior If you have time to look at the code, let me know if you spot something that violates Raft: more than one leader or leader not being the one with the highest term/longest log.

from jgroups-raft.

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.