首页 > 试题广场 >

Consider a failure that occurs

[问答题]

Consider a failure that occurs during 2PC for a transaction.For each possible failure,explain how 2PC ensures transaction atomicity despite the failure.

推荐
Possible failures inc lude (1)failure of a participating site,(2) failure of the coordinator,and (3) failure of the network.We consider each approach in the following:
Failure of a Participating Site- When a participating site recovers from a failure,it must examine its log to determine the fate of those transactions that were in the midst of execution when the failure occurred.The system will then accordingly depending upon the type of log entry when the failure occurred.
Failure of the Coordinator- If the coordinator fails in the midst of the execution of the commit protocol for transaction T,then the participating sites must decide on the fate of T. The participating sites will then determine toeither commit or abort T or wait for the recovery of the failed coordinator.
Failure of the Network- When a link fails,all the messages in the process of being routed through the link do not arrive at their destination intact.From the viewpoint of the sites connected throughout that link,the other sites appears to have failed.Thus,either of the approaches discussed above apply.
发表于 2018-03-25 10:14:59 回复(0)