Databases Reference
In-Depth Information
server replies C-READY if it is ready to commit. After that point, it
cannot abort the transaction unless instructed to do so by the coor-
dinator. Alternatively, a server replies C-REFUSE if it is unable to
commit.
Phase 2: If the coordinator receives C-READY from all servers, it
transmits C-COMMIT to all servers. Each server commits on receiv-
ing this message. If the coordinator receives C-REFUSE from any
server, it transmits C-ROLLBACK to all servers. Each server aborts
on receiving this message.
·
Provided none of the servers crashes and there are no network errors, 2PC
will provide a reliable and robust distributed atomic commitment protocol.
However, we must take into account failures occurring, which introduces
the concept of having some termination protocol to deal with situations in
which the atomic commitment protocol is not being obeyed. Some failures
are easily handled by having timeouts associated with communication. For
example, the coordinator may not receive a reply from one failed server and
then might decide to abort the transaction using C-ROLLBACK. Alterna-
tively, the coordinator may fail after asking for a vote, in which case all the
servers will time out and then contact each other to elect a new coordinator
and continue with the transaction.
For some errors, however, the protocol has a weakness in that a server
may become blocked. That will occur after a server has sent a C-READY
reply, which entails that it must commit if and when it receives
C-COMMIT. In this circumstance, two failures can occur that require con-
tradictory action by the server:
Immediately after sending C-PREPARE, the coordinator might
have crashed. One other server might have replied C-REFUSE and
aborted its transaction. If this was the case, it would be correct for
the server to abort its transaction, even after sending C-READY.
·
The coordinator might have sent C-COMMIT to all other servers
and then crashed. Those other servers might have committed their
transactions and then also crashed. It would then be correct for the
server to commit its transaction.
·
For the server that issued the C-READY and has received no reply, those two
situations would be identical—the server is unable to get information from
Search WWH ::




Custom Search