经常听到有文章引用下面这句话:在同步系统中容错率可以达到50%,而在异步系统中容错率下降到33%。
实际上这句话是有问题的,早在1985年Michael J. Fischer, Nancy Lynch, 和Mike Paterson已经证明,在一个完全异步的系统中,没有任何一种共识算法可以容忍哪怕一个错误节点,史称FLP不可能性证明(FLP是他们三个人名字的缩写)。所以,上面那句话应该把“异步系统”修正为“部分同步系统”。
那么问题来了,到底什么是同步系统,异步系统,和部分同步系统呢?
同步系统(Synchronous System)
援引《Introduction to Reliable and Secure Distributed Programming》第46页中的权威定义:
- Synchronous computation. There is a known upper bound on processing delays. That is, the time taken by any process to execute a step is always less than this bound. Remember that a step gathers the delivery of a message (possibly nil) sent by some other process, a local computation (possibly involving interaction among several layers of same process), and the sending of a message of some other process (possibly omitted).
- Synchronous communication. The