Author | Message |
---|---|
cysun
Posts: 2935
|
Posted 16:46 Dec 06, 2015 |
I'd like to clarify a few things about Multiversion Locking Protocol (MLP). First, when we talk about MLP, we only talk about the rules for read-only transactions, and that's because the assumption is that the non-read-only transactions (i.e. transactions with writes) still follow the same rules of a serializable locking scheme like 2PL. In other words, you can think of MLP as 2PL with special rules for the read-only transactions. And when you design an MLP example, make sure the schedule involving the non-read-only transactions is serializable. For example, a schedule like w1(x),w2(x),w2(y),w1(y) is not possible under MLP. Second, the correctness of MLP (i.e. the resulting schedule being serializable) is fairly obvious. Take the example in the lecture notes as an example. We know without T3, the schedule involving T1, T2, and T4 is serializable and it's equivalent to the serial schedule T1,T4,T2. Now adding T3 - because it reads from T1, we can simply insert it after T1 and the whole schedule is equivalent to the serial schedule T1,T3,T4,T2. Third, although you can still use precedence graph to check for serializability, be careful because due to the way read-only transactions work, the order of conflicting operations in a schedule may not reflect the actual precedence of the operations. Again, we can use the example in the lecture notes "w1(b1),w1(b2),c1,w2(b1),r3(b1),...". Note that normally because of "w2(b1),r3(b1)", we would have an edge T2->T3 in the precedence graph. However, because T3 is a read-only transaction, it reads from T1 instead of T2, so under MLP, instead of T2->T3, it's actually T1->T3. |