Exercise 9: Distributed Reliability

DSCB Ex 20.5.1

Consider a transaction T initiated at a home computer that asks bank B to transfer $10,000 from an account at B to an account at another bank C.

a) What are the components of distributed transaction T? What should the components at B & C do?

b) What can go wrong if there is not $10,000 in the account at B?

c) What can go wrong if one or bother banks’ computers crash, or if the network is disconnected?

d) If one of the problems suggested in (c) occurs, how could the transaction resume correctly when the computers and network resume operation?

DSCB Ex 20.5.2

In this exercise, we need a notation for describing sequences of messages that can take place during a two-phase commit. Let (i,j,M) mean that site i sends the message M to site j, where the value of M and its meaning can be

We shall discuss a simple situation in which site 0 is the coordinator, but not otherwise part of the transaction, and site 1 and 2 are the components. For instance, the following is one possible sequence of messages that could take place during a successful commit of the transaction:

(0,1,P), (0,2,P), (2,0,R), (1,0,R), (0,2,C), (0,1,C)

a) Give an example of a sequence of messages that could occur if site 1 wants to commit and site 2 wants to abort.

b) How many possible sequences of messages such as the above are there, if the transaction successfully commits?

c) If site 1 wants to commit, but site 2 does not, how many sequences of messages are there, assuming no failures occur?

d) If site 1 wants to commit, but site 2 is down and does not respond to messages, how many sequences are there?