raft leader是同步还是异步处理客户端请求?

时间:2017-12-18 03:02:11

标签: algorithm raft leader

在筏子里,领导者

  • 收据请求,
  • 转义日志条目,
  • 发送RPC,
  • 适用于状态机
  • 最后回复客户。

这个过程需要一些时间,那么,如何处理下一个请求?拒绝它们?

2 个答案:

答案 0 :(得分:0)

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.

答案 1 :(得分:0)

大多数筏实施都使用流水线操作,您可以在飞行中从主站到从站进行多次登录。 但是,主设备仅在主设备收到来自法定数量的从设备的ACK响应后才响应客户端写入请求,其日志偏移量等于或大于写入客户端请求的日志偏移量。

相关问题