Git Product home page Git Product logo

Comments (3)

armon avatar armon commented on June 12, 2024

Yeah, it's a subtle detail of how we've implemented raft. It's from section 5.3 on log replication. For a number of reasons, we do the heartbeats async from the AppendEntries with actual log data. Mostly it's to avoid head of line blocking on network and disk. Because of this decoupling, heartbeat does not include the leaderCommit value (highest committed index), since the replication may be lagging (any number of reasons). We only send that value in the replication stream. As a result, suppose I commit log at index 10. If there is no more write operations (e.g. nothing at index 11), then there is no way to update the leaderCommit of the followers. We use a CommitTimeout to instead replicate no logs, but to update the leaderCommit of the followers. In practice, it works the same as doing it in the heartbeat, but we avoid a number of other issues in favor of higher stability.

from raft.

stapelberg avatar stapelberg commented on June 12, 2024

Thanks for clarifying that. I’m still wondering, though: wouldn’t it be enough to trigger one additional AppendEntries after a successful commit to get leaderCommit to the followers, instead of sending 20/s (default setting)? :)

from raft.

armon avatar armon commented on June 12, 2024

Indeed. We used to do that :) But in practice you get all sorts of fun situations like a user restarting Consul in a way that causes data loss (e.g. replication log moves backward in time). With the no-op optimization we end up missing that and stalling the replication. Doing the AppendEntries is relatively cheap.

from 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.