30 4 1983 the proof of serializability and deadlock

Info icon This preview shows pages 3–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Vol. 30, 4, 1983. (The proof of serializability and deadlock freedom of the original tree protocol may be found in Sil- berschatz and Kedem, Consistency in Hierarchical Database Systems , JACM Vol. 27, 1, Jan 1980.) It is worth noting that if the protocol were modified to allow update transactions to lock any data item first, non-serializable executions can occur. Intuitively, a long running readonly transaction T 0 may precede an update transaction T 1 on node a , but continues to holds a lock on child node b . After T 1 updates a and commits, readonly transaction T 2 reads a , and thus T 1 precedes T 2 . However, T 2 now overtakes T 1 , share locking b and its child c (not possible with only exclusive locks), and reads c and
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
4 Chapter 15 Concurrency Control commits. Subsequently, transaction T 3 updates c and commits, after which T 0 share locks and reads c . Thus, there is a cycle T 0 T 1 T 2 T 3 T 0 In effect, two readonly transactions see two different orderings of the same two update transactions. By requiring update transactions to always start at the root, the protocol ensures that the above situation cannot occur. In the above example T 3 would be forced to start from the root, and thus T 0 cannot be serialized after T 3 . The formal proof is by induction on the number of read-only transactions (and, we must admit, not very intuitive). We present it after introducing some notation first: Q X : the set of update transactions. Q S :the set of Read-only transactions. L ( T i ) : the set of data items locked by transaction T i Let Q the new protocol. Suppose T i and T k are update transactions, and T j a read only transaction; then if T j overlaps with T i and T k in the set of data items it accesses, since T i and T k both start from the root, T i and T k must also overlap on the set of data items accessed. Formally, T i Q X T j Q S T k Q X [(( L ( T i ) intersectiontext L ( T j )) negationslash= H9278 ( L ( T j ) intersectiontext L ( T k )) negationslash= H9278 ) ( L ( T i ) intersectiontext L ( T k )) negationslash= H9278 ] Consider an arbitrary schedule of transactions in protocol Q . Let k be the number of Read-only transactions which participate in this schedule. We show by induction that there exist no minimal cycles in ( T , ), where T i T j denotes that T i precedes T j due to a conflict on some data item. Let the cycle without loss of generality be, T 0 T 1 ... T m 1 T 0 Here, we know that m 2 k , as there must be an Update transaction on each side of a Read-only transaction, otherwise the cycle will not be formed. k = 0: In this case each T i is in Q X , so Q becomes the original tree protocol which ensures the serializability and deadlock freedom. k = 1: Let T i be the unique transaction in Q S . We can replace T i by T X i . The resulting schedule follows the original tree protocol which ensures serializability and deadlock freedom.
Image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern