Giter VIP home page Giter VIP logo

Comments (4)

belaban avatar belaban commented on July 24, 2024

Looks like REDIRECT doesn't block, but is just very slow when the leader itself performs a mass increment of the counter. If A increments by 100 and B 100'000, or vice versa, concurrently, then - as soon as the first instance is done - the other instance increments very quickly.

from jgroups-raft.

belaban avatar belaban commented on July 24, 2024

Looks like the culprit is RAFT.resend_interval which is 1000 by default. Lowering it (e.g. to 100) speeds things up dramatically. Investigating why resend_interval is causing this.

from jgroups-raft.

belaban avatar belaban commented on July 24, 2024

The reason why resend_interval is important is the following scenario:

  • A sends messages with indices [34..38], B's prev_index is 33
  • B receives 34, sets prev_index to 34
  • B receives 35, sets prev_index to 35
  • B receives 37, drops it as its prev_index of 36 doesn't match the current prev_index of 35
    ** The reason for the out of order message is that the threads in A grab indices and then the order of message delivery depends on which thread reached NAKACK2 first
  • B receives 36, sets prev_index to 36
  • B receives 38, but drops it as its prev_index of 37 doesn't match the current prev_index of 36

So messages with indices 37 and 38 will not get appended to the log of B until the resend_task kicks in (by default every 1000 ms).

Suggested solutions:

  1. When sending a message in RAFT, extend the scope of the lock where the index is incremented until after the message has been sent. Downside: bad concurrency
  2. When receiving a message that's out of order, return false to the sender, but still append the message to the log.

from jgroups-raft.

belaban avatar belaban commented on July 24, 2024

OK, I chose solution 1

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.