[译]仅一个进程故障就无法(在异步系统)实现分布共识(FLP)
https://ying-zhang.cn/dist/1985-flp-cn/
Impossibility of Distributed Consensus with One Faulty Process
Michael J. Fischer, Yale University, New Haven, Connecticut
Nancy A. Lynch, Massachusetts Institute of Technology, Cambridge, Massachusetts
and
Michael S. Paterson, University of Warwick, Coventry, England
Journal of the Association for Computing Machinery (JACM), Vol. 32, No. 2, pp. 374-382, April 1985.
doi.org/10.1145/3149.214121
原文 html
PODC 2001 Influential Paper Award
译者:Ying ZHANG. 2021-06, 08; 2023-05.
原文重排版 PDF
译文 PDF
Editing of this paper was performed by guest editor S. L. Graham. The Editor-in-Chief of JACM did not participate in the processing of the paper.
This work was supported in part by the Office of Naval Research under Contract N00014-82-K-0154, by the Office of Army Research under Contract DAAG29-79-C-0155, and by the National Science Foundation under Grants MCS-7924370 and MCS-8116678.
This work was originally presented at the 2nd ACM Symposium on Principles of Database Systems, March 1983.
Authors' present addresses: M. J. Fischer, Department of Computer Science, Yale University, P.O. Box 2158, Yale Station, New Haven, CT 06520; N. A. Lynch, Laboratory for Computer Science, Massachusetts Institute of Technology, 545 Technology Square, Cambridge, MA 02139; M. S. Paterson, Department of Computer Science, University of Warwick, Coventry CV4 7AL, England
Permission to copy without fee all or part of this material is granted provided that the copies are not made or distributed for direct commercial advantage, the ACM copyright notice and the title of the publication and its date appear, and notice is given that copying is by permission of the Association for Computing Machinery. To copy otherwise, or to republish, requires a fee and/or specific permission.
© 1985 ACM 0004-5411/85/0400-0374 $00.75
Journal of the Association for Computing Machinery, Vol. 32, No. 2, April 1985, pp. 374-382.
摘要:异步系统的共识问题(consensus)涉及一组进程,其中有的进程可能不可靠(unreliable)。共识问题要求可靠的进程一致地从两个侯选中决定(agree)一个。本文表明解决该问题的任何协议都可能不终止,即使故障(faulty)进程只有一个。相比而言,同步系统的共识问题,即“拜占庭将军”问题,已有解决方案。
1. 简介
远程进程之间达成一致(agreement)的问题是分布计算中最基本的问题之一,是分布数据处理、分布文件管理和容错分布式应用涉及的多种算法的核心。
该问题的一种常见形式是“事务提交(commit)问题”,它源于分布数据库系统[6, 13, 15-17, 21-24](另见与G. LeLann的私人通信[15])。该问题是指参与某个事务的所有数据管理进程都达成一致:是将事务的结果写入数据库,还是丢弃结果(中止事务)。中止操作可能是必要的,例如,由于某种原因,有些数据管理进程无法完成所需的事务处理。无论做出哪个决定,所有数据管理进程都必须做出相同的决定,使数据库仍够保持约束(consistency)译注:事务提交问题与共识问题虽有相似之处,但也有关键差异:事务提交中,只要有参与进程提出中止,那么该事务必须中止;而共识则不关心参与进程提出的值,最终的共识值可以是任一进程提出的值。
如果参与事务的进程和网络完全可靠,那么“提交”问题达成一致就很简单了。然而,真实系统会遇到许多可能的故障,例如进程崩溃、网络分区以及消息丢失,损坏或重复。甚至还有拜占庭类型的故障[5, 7, 8, 11, 14, 18, 19],故障的进程可能完全失控,甚至可能发送恶意消息。因此,需要一种在出现故障时尽可能可靠的共识协议。当然,如果故障过于频繁或过于严重,那么任何协议都可能无法工作,因此希望有一种能够容忍规定数量“预期”故障的协议。
在本文,我们展示了一个令人惊讶的结果,即纯异步的,可容忍甚至仅一个进程意外故障(a single unannounced process death)的共识协议都是不可能的。我们不考虑拜占庭故障,我们假设消息系统是可靠的——所有消息投递正确且恰好一次。但是,即使有这些假设,单个进程在特定时机崩溃(stopping)仍能阻止任何分布式提交协议达成共识。因此,如果不对计算环境做进一步的假设,或者对可容忍的故障类型有更强的限制,那么这个重要的问题就没有健壮的解决方案!
我们证明的关键是,操作是纯异步的;也就是说,我们不对进程的相对速度或投递消息的延迟时间做任何假设。我们还假设进程无法访问同步的时钟,因此无法使用基于超时的算法(特别是,[6]中的解决方案不适用)。最后,我们不假设检测进程崩溃(death)的能力,因此一个进程无法区分另一进程是已经崩溃了(完全停止)还是执行得非常慢。
我们的不可能结果甚至适用于共识问题的一种非常弱的形式。假设每个进程的初始值来自集合
我们的系统模型相当强大,使我们的不可能性证明尽可能广泛适用。进程建模为通过消息通信的自动机(可能有无限多个状态)。在一个原子的步骤中,进程可以尝试接收消息,根据是否有消息投递给自己(如果有,是哪条消息)来执行本地计算,然后向其它进程发送任意但有限数量的一组消息。特别的,假定具有“原子广播”功能,因此进程可以在一个步骤内向所有其它进程发送相同的消息,并且肯定,如果任一无故障进程收到此消息,那么所有无故障进程都将收到。只要目标进程无限次尝试接收,每条消息最终都会被投递,但是消息可能被延迟任意长时间,且可能乱序投递。
当前使用的异步提交协议似乎都有一个“危险窗口”——算法执行期间的一个时段,其中单个进程的延迟或不可达可能导致整个算法无限期等待。根据我们的不可能结果,每个提交协议都有这样一个“窗口”,证实了大家广泛持有的信条。
2. 共识协议
共识协议
进程通过互相发送消息来通信。消息是二元组
:- 将
放入消息缓冲区; :- 从缓冲区删除消息
,并返回 。这种情况下,我们说 已投递;或返回特殊的空值标记 ,且不改变缓冲区。
因此,消息系统的动作不是确定的,仅满足以下条件:如果无限次执行
系统的配置(configuration)由各进程的内部状态及消息缓冲区的内容组成。初始配置是指各进程处于初始状态且消息缓冲区为空的配置。
一个步骤(step)将一个配置转换到另一个配置,且仅由单个进程
从
以下引理表明调度的“交换性”(commutativity)。
引理 1:假设从某配置
证明:因为
如果某个进程
- 所有可达配置的决定值不超过一个。
- 某个可达配置的决定值为
,且 。
若在某次执行中,进程
若某个进程在执行中达到决定状态,就称此次执行是有决定的(deciding)。如果共识协议
3. 主要结果
定理 1:没有共识协议在一个进程故障情况下仍完全正确(No consensus protocol is totally correct in spite of one fault)。
证明:反证。假设共识协议
基本想法是展示协议永远无法决断的情况。这包括两个步骤。首先,我们表明存在某个初始配置,不能预先确定决定值。其次,我们构造一个可接受的执行,总是避免系统执行做出决定的步骤。
令
引理 2:
证明:假设不存在。因为假设
现在考虑从
引理 3:令
证明:既然
假设
令
若一个配置经一步到达另一个配置,则称这两个配置是邻居(neighbors)。通过简单的归纳,存在邻居
情况1:若
情况2:若
令
在每种情况下,我们都遇到了矛盾,所以
任意有决定的执行都是从某个双值的初始配置到单值配置,因此必然存在从双值配置到单值配置的单一步骤。该步骤决定了最终的值。我们要表明,总是可以驱动系统避免此步骤,从而导致可接受但无法决定的执行。
上述执行由若干阶段组成,从初始配置开始。我们通过以下方式确保执行是可接受的。维护一个进程队列,初始顺序是任意的,配置的消息缓冲区按消息发送的时间排序,最早的在先。每个阶段由一个或多个进程步骤组成。若进程队列中队首进程完成如下的步骤,就认为一个阶段结束了。所述步骤是,若阶段开始时,其消息队列不为空,则接收其最早的消息,将此进程移到进程队列的末尾。这种阶段构成的无限序列中,每个进程都执行无限多的步骤,接收到发送给它的每条消息。因此,该执行是可接受的。当然,我们还要阻止做出决定。
令
由于每个阶段都以双值配置结束,组成无限调度的每个阶段都会成功。由此产生的执行是可接受的,并且永远不会做出任何决定。从而
4. 初始存在故障进程的情况
在本节,我们展示了一个解决
该协议分两个阶段。在第一阶段,进程构建一个有向图
在第二阶段,进程构建
为了实现这个阶段,每个进程向所有其它进程广播它的进程号和初始值,以及它在第一阶段收到的
此时,每个进程都知道了
最后,每个进程基于初始团中进程的初始值,使用事先确定的规则做出决定。由于所有进程都知道初始团中所有成员的初始值,因此它们都会做出相同的决定。
该协议的正确性证明了以下定理。
定理 2:存在部分正确的共识协议,其中所有无故障进程总是会做出决定,前提是在其执行期间没有进程故障,且初始有过半数进程是正常的。
5. 结论
我们已经表明,容错协作计算的一个自然而重要的问题无法在纯异步的计算模型中解决。这些结果并没有表明此类问题在实践中无法“解决”;相反,它们指出需要改进的分布计算模型,以更好地反映有关进程和通信时序的实际假设;或者放松此类问题对解决方案的要求(例如,要求以概率1终止)。在最初发表[12]这些结果之后,这两条路线都取得了进展[1-4, 9, 10, 20, 25]。
致谢:作者感谢John Guttag在本文初期的有益讨论,以及Gene Stark关于结果的讨论并仔细阅读了内容。作者还感谢审稿人指出了几处需要改进的表述。
参考文献
- ATTIYA, C., DOLEV, D., AND GIL, J. Asynchronous Byzantine consensus. In Proceedings of the 3rd Annual ACM Symposium on Principles of Distributed Computing (Vancouver, B.C., Canada, Aug. 27-29). ACM, New York, 1984, pp. 119-133.
- BEN-OR, M. Another Advantage of Free Choice: Completely Asynchronous Agreement Protocols. In Proceedings of the 2nd Annual ACM Symposium on Principles of Distributed Computing (Montreal, Quebec, Canada, Aug. 17-19). ACM, New York, 1983, pp. 27-30.
- BRACHA, G. An asynchronous
-resilient consensus protocol. In Proceedings of the 3rd Annual ACM Symposium on Principles of Distributed Computing (Vancouver, B.C., Canada, Aug. 27-29). ACM, New York, 1984, pp. 154-162. - BRACHA, G., AND TOUEG, S. Resilient consensus protocols. In Proceedings of the 2nd Annual ACM Symposium on Principles of Distributed Computing (Montreal, Quebec, Canada, Aug. 17-19). ACM, New York, 1983, pp. 12-26.
- DEMILLO, R. A., LYNCH, N. At, AND MERRITT, M. J. Cryptographic protocols. In Proceedings of the 14th Annual ACM Symposium on Theory of Computing (San Francisco, Calif., May 5-7). ACM, New York, 1982, pp. 383-400.
- DOLEV, D., AND STRONG, H. R. Distributed commit with bounded waiting. In Proceedings of the 2nd Annual IEEE Symposium on Reliability in Distributed Software and Database Systems. IEEE, New York, 1982, pp. 53-60.
- DOLEV, D., AND STRONG, H. R. Polynomial algorithms for multiple processor agreement. In Proceedings of the 14th Annual ACM Symposium on Theory of Computing (San Francisco, Calif., May 5-7). ACM, New York, 1982, pp. 401-407.
- DOLEV, D., FISCHER, M., FOWLER, R., LYNCH, N., AND STRONG, H. R. An efficient algorithm for Byzantine agreement without authentication. Inf. Control 52, 3 (1983), 257-274.
- DOLEV, D., LYNCH, N., PINTER, S., STARK, E., AND WEIHL, W. Reaching approximate agreement in the presence of faults. In Proceedings of the 3rd Annual IEEE Symposium on Reliability in Distributed Software and Database Systems. IEEE, New York, 1983, pp. 145-154.
- DWORK, C., LYNCH, N., AND STOCKMEYER, L. Consensus in the presence of partial synchrony. In Proceedings of the 3rd Annual ACM Symposium on Principles of Distributed Computing (Vancouver, B.C., Canada, Aug. 27-29). ACM, New York, 1984, pp. 103-118.
- FISCHER, M., AND LYNCH. N. A lower bound for the time to assure interactive consistency. Inf. Proc. Lett. 14, 4 (1982), 183-186.
- FISCHER, M., LYNCH, N., AND PATERSON, M. Impossibility of distributed consensus with one faulty process. In Proceedings of the 2nd Annual ACM SIGACT-SIGMOD Symposium on Principles of Database Systems (Atlanta, Ga., Mar. 21-23). ACM, New York, 1983, pp. 1-7.
- GARCIA-MOLINA, H. Elections in a distributed computing system. IEEE Trans. Comput. C-31, 1 (1982), 48-59.
- LAMPORT, L., SHOSTAK, R., AND PEASE, M. The Byzantine Generals problem. ACM Trans. Prog. Lang. syst. 4, 3 (July 1982), 382-401.
- LAMPSON, B. Replicated Commit. CSL Notebook Entry, Xerox Palo Alto Research Center, Palo Alto, Calif., 1981.
- LAMPSON, B., AND STURGIS, H. Crash recovery in a distributed data storage system. Manuscript, Xerox Palo Alto Research Center, Palo Alto, Calif., 1979.
- LINDSAY, B. G. , SELINGER, P. G., GALTIERI, C., GRAY, J. N., LORIE, R. A., PRICE, T. G., PUTZOLU, F., TRAIGER, I. L., AND WADE, B. W. Notes on distributed databases. IBM Res. Rep. RJ2571, IBM Research Division, San Jose, Calif., 1979.
- LYNCH, N., FISCHER, M., AND FOWLER, R. A simple and efficient Byzantine Generals algorithm. In Proceedings of the 2nd Annual IEEE Symposium on Reliability in Distributed Software and Database Systems. IEEE, New York, 1982, pp. 46-52.
- PEASE, M., SHOSTAK, R., AND LAMPORT, L. Reaching agreement in the presence of faults. J. ACM 27, 2 (Apr. 1980), 228-234.
- RABIN, M. Randomized Byzantine Generals. In Proceedings of the 24th Annual IEEE Symposium on Foundations of Computer Science. IEEE, New York, 1983, pp. 403-409.
- REED, D. Naming and synchronization in a decentralized computer system. Ph.D. dissertation, Technical Report MIT/LCS/TR-205, Massachusetts Institute of Technology, Cambridge, Mass., 1978.
- ROSENKRANTZ, D. J., STEARNS, R. E., AND LEWIS, P. M., II. System level concurrency control for distributed database systems. ACM Trans. Database Syst. 3, 2 (June 1978), 178-198.
- SKEEN, D. A decentralized termination protocol. In Proceedings of the 2nd Annual IEEE Symposium on Reliability in Distributed Software and Database Systems. IEEE, New York, 1982, pp. 27-32.
- SKEEN, D., AND STONEBRAKER, M. A formal model of crash recovery in a distributed system. IEEE Trans. Softw. Engineering SE-9, 3 (May 1983), 219-228.
- TOUEG, S. Randomized Byzantine Agreements. In Proceedings of the 3rd Annual ACM Symposium on Principles of Distributed Computing (Vancouver, B.C., Canada, Aug. 27-29). ACM, New York, 1984, PP. 163-178.
1983年9月收稿;1984年10月修订;1984年10月录用。