Does raft leader deal with client requests synchronously or asynchronously?

601 views Asked by At

In raft, the leader

  • receipt requests,
  • escape log entries,
  • send RPCs,
  • apply to state machine
  • and finally response the clients.

this process need some time,so ,how to deal with next requests?refuse them ?

2

There are 2 answers

1
mcdowella On

The point of Raft is that all of the participants that are still working agree on what the state of the system is (or at least they should do once they have time to find out what the total consensus is). This means that they all agree on what messages have been received, and in what order. This also means that they must all get the same answer when they compute the consequences of receiving those messages. So the messages must be processed sequentially, or if they are processed in parallel, the participants have to use transactions and locking and so on so that the effect is as if the messages were processed sequentially. Under load, responses can be delayed, or some other sort of back-pressure used to get the senders to slow down, but you can't just drop messages because you are too busy, unless you do it in a way that ensures that all participants take the same decisions about this.

0
skyde On

Most raft implementation are using pipelining you can several log entry in flight from master to slave. But the master only respond to client write request with success after the master received a ACK response from a quorum of slave for a log offset equal or greater than the log offset this client request was written to.