3Phase commit protocol - Distributed System

249 views Asked by At

I got asked this question in one of my interviews. I am curious about the answer for this question:

What will happen if in 3 phase commit protocol after sending pre-commit message, the co-ordinator receives positive response from all the resource managers, and when coordinator sends commit command, one of the resource manager fails to commit?

Any thoughts on this would be appreciated.

Thanks.

1

There are 1 answers

0
Michael Deardeuff On

Good question. In the situation you described, it was past the point of no return: the transaction is considered as committed.

If the problem was that the "failed" resource manager was actually just partitioned from the coordinator, then it will timeout and commit the transaction itself.

If the problem was that the resource-manager had died, then when it recovers it will commit the transition. If the resource-manager died forever, then it doesn't matter what happened on it.

Sources: