3

I am currently studying 2 phase and 3 phase commit.

The 3PC protocol tries to eliminates the 2PC protocol’s system blocking problem by adding an extra phase, preCommit. As mentioned here

According to this post, If the co-ordinator crashed at any point, a recovery node can take over the transaction and query the state from any remaining replicas. For example, if any remaining replicas replied to the recovery node it is in pre-commit state, then recovery node will know that the failed coordinator has sent pre-commit message, and all replicas has agreed to commit.

My question is, Why can't Two phase commit do the same thing? When the coordinator failed, the recovery node query those remaining nodes and see any of them already in Commit phase?

I have read server posts but still I don't what exact problem 3 phase commit is trying to solve and how it is solved?

Please help!

HKIT
  • 628
  • 1
  • 8
  • 19
  • If replicas have already started committing, then the coordinator died after completing the protocol. The problematic case is what happens if it gathers the responses from the replicas but dies before it can tell them to commit – sinanspd Apr 16 '22 at 07:52
  • 1
    @sinanspd If the coordinator dies before it can tell replicas to commit, then no replicas should be in the Commit phase. Then the recovery node should be able to know it by asking any remaining replicas. And the recovery node can tell all replicas to Abort. If should be safe as no replicas has committed. Is it possible? – HKIT Apr 17 '22 at 01:21
  • 1) Rollbacks are expensive 2) what happens if a replica crashes before it can receive the abort message ? – sinanspd Apr 17 '22 at 09:31

0 Answers0