

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


CSEP 545 Transaction Processing for E-Commerce 2/29/
Assignment 8 1
a) Database DB1 is read-only.
b) Database DB1 processes update transactions. The major challenge is synchronizing the updates, which have to be applied and synchronized at all replicas.
No. 1SR is not guaranteed even if each site uses 2PL (providing local serializability) and 2PC (providing atomic commitment). To show this, suppose the database has two elements x and y and is replicated on two servers A and B.
T 1 = r 1 (x), w 1 (y) T 2 = r 2 (y), w 2 (x)
Site A rl 1 (xa) r 1 (xa) wl 1 (ya) w 1 (y (^) a) ru1 (xa) wl 2 (x (^) a) w 2 (xa) C 1 C 2 Site B rl 2 (yb ) r 2 (yb) wl 2 (xa) w 2 (x (^) a) ru2 (ya) wl 1 (y (^) b ) w 1 (yb ) C 1 C 2
CSEP 545 Transaction Processing for E-Commerce 2/29/
Assignment 8 2
Each transaction obeys 2PL. It holds its read locks until just before it commits and holds its write locks until after it commits on both servers A and B. 2PC steps are omitted (since they don’t change the example) as are unlock operations after commits.
The execution is not 1SR since in a serial execution on a one-copy database, one of the transactions would have read the other one’s output, which did not occur in this execution.
The problem here is the early release of read locks. If read locks were held until after commit, then the execution couldn’t arise.
T is non-deterministic, writing different values with each execution.
If T is used for update propagation, replicas will contain different values for data item w. To remedy the non-determinism, time.now() can be replaced with a time value, such as Feb 29, 2012 12:00 am. Non-determinism should be resolved before execution on the resource manager, for example, at the client or in replication middleware.
The answer is unchanged when T executes multiple times. Ordinarily, it matters that transactions execute in the same order on both replicas. However, with T, the only effect of transaction order is the value returned by time.now(), which is the same problem noted above. However, if the system ran transactions that don’t commute, then it would be important that they executed in the same order on both systems.