Does biphasic locking protect against final failures?

Assume that all databases involved in a distributed transaction implemented with a two-phase commit signal are ready for commit and have the necessary locks. The coordinator signals the commits, and all the databases fulfill their part of the transaction, but one SQL database encounters a zero-delimited error as a result of programming control that does not take this possibility into account. Since the coordinator has already signaled to everyone, what happens as a result of this division by zero?

+6
source share
1 answer

The second commit phase usually does not contain a user code that may fail. Participating resource managers must ensure that a failure cannot occur. If this warranty is violated, no warranty can be provided by protocol.

Two-phase commit is trying to solve the Two Generals problem. There is no complete solution to this problem. TPC is an approximation.

Another way that a TPC can fail is in the case of a network partition. Some resource managers may perform a final commit, but some may not receive this message. Again, this problem is insoluble. Even repeated attempts cannot solve it.

You can even cause this problem in real conditions: run all the participating nodes in the stress test and pull the network cable at an arbitrary point. With a high probability, your distributed databases are now incompatible, because some commit messages are lost very uncomfortably.

+4
source

Source: https://habr.com/ru/post/918837/


All Articles