三相提交如何避免阻塞? [英] How does three-phase commit avoid blocking?

查看:168
本文介绍了三相提交如何避免阻塞?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图了解三相提交如何避免阻塞

I am trying to understand how three-phase commit avoids blocking

请考虑以下两种失败情况:

Consider the following two failure scenarios:

场景1:在阶段2中,协调器向所有同类群组发送preCommit消息,并获得了除同类群组A之外的所有用户的确认.网络问题阻止了同类群组A接收协调者的preCommit消息.同类群组A等待preCommit消息超时并选择中止.然后协调员和队列A都崩溃了.

Scenario 1: In phase 2 the coordinator sends preCommit messages to all cohorts and has gotten an ack from all except cohort A. Network problems prevent cohort A from receiving the coordinator's preCommit message. Cohort A times out waiting for the preCommit message and chooses to abort. Then both the coordinator and cohort A crash.

方案2:协议到达阶段3.协调器向队列A发送doCommit消息.但是,在协调器可以发送更多doCommit消息之前,协调器崩溃.同类群组A提交了交易的一部分,然后崩溃了.

Scenario 2: The protocol reaches phase 3. The coordinator sends a doCommit message to cohort A. But before it can send more doCommit messages the coordinator crashes. Cohort A commits its part of the transaction then crashes.

据我所知,其余的队列在方案1和方案2的末尾具有完全相同的状态.因此,当恢复协调员介入时,如何从其余的队列中找出我们是否在方案1和方案2中?中止还是我们处于场景2中并提交,从而避免阻塞?

As far as I can tell the remaining cohorts have the exact same state at the end of scenario 1 and scenario 2. So when a recovery coordinator steps in how can it find out from the remaining cohorts whether we are in scenario 1 and abort or we are in scenario 2 and commit and thus avoid blocking?

推荐答案

三相提交不是魔术.它比两阶段提交更具弹性.特别是3PC可以抵抗单点故障,但不能抵抗所有的多点故障.问题中的两种情况都存在两点故障.换句话说,这个问题的前提是错误的.对3PC的要求超出了它的能力.

Three-phase commit isn't magic; it's just more resilient than two-phase commit. In particular, 3PC is resilient against single-point failure, but not all kinds of multiple-point failure. Both scenarios in the question posit two-point failures. In other words, the premise of the question is misguided; it's asking more of 3PC than it's capable of.

为进一步阅读,以下是该主题论文摘要的句子,

For further reading, here's a sentence from the abstract of a paper on the subject, Analysis and Verification of Two-Phase Commit & Three-Phase Commit Protocols, by Muhammad Atif, to whet your appetite:

我们还将我们的方法应用于其修正"变体三相" 提交协议(3PC)并证明它同时存在是错误的 网站故障

We also apply our method to its "amended" variant, the Three-Phase Commit Protocol (3PC) and prove it to be erroneous for simultaneous site failures

我发现本文为立足文献提供了立足之地.如果您想深入研究,在这个主题上有很多.

I found this paper to provide a foothold into the literature. There's no small amount of it on this subject, if you want to delve in.

这篇关于三相提交如何避免阻塞?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆