Question

In: Computer Science

Show that the multi-version read consistency algorithm ensures serializability. That is, read-only transactions use the multi-version...

Show that the multi-version read consistency algorithm ensures serializability. That is, read-only transactions use the multi-version technique whereas read-write transactions use strict two phase locking.

Solutions

Expert Solution

Given in the data that a multi-version database, where each data item is a sequence of its versions. The number of versions of a data item may be limited or not.

Suppose we have n transactions T1, T2, ..., Tn such that they all obey the basic

two-phase locking rule (i.e. no transaction has an unlock operation followed by a lock

operation). Suppose that a non-(conflict)-serializable schedule S for T1, T2, ..., Tn

does occur; then, according to Section 17.5.2, the precedence (serialization) graph for

S must have a cycle. Hence, there must be some sequence within the schedule of the form:

S: ...; [o1(X); ...; o2(X);] ...; [ o2(Y); ...; o3(Y);] ... ; [on(Z); ...; o1(Z);]...

where each pair of operations between square brackets [o,o] are conflicting (either [w,

w], or [w, r], or [r,w]) in order to create an arc in the serialization graph. This

implies that in transaction T1, a sequence of the following form occurs:

T1: ...; o1(X); ... ; o1(Z); ...

Furthermore, T1 has to unlock item X (so T2 can lock it before applying o2(X) to follow

the rules of locking) and has to lock item Z (before applying o1(Z), but this must occur

after Tn has unlocked it). Hence, a sequence in T1 of the following form occurs:

T1: ...; o1(X); ...; unlock(X); ... ; lock(Z); ...; o1(Z); ...

This implies that T1 does not obey the two-phase locking protocol (since lock(Z) follows

unlock(X)), contradicting our assumption that all transactions in S follow the two-phase

locking protocol.

Suppose two-phase locking does not ensure serializability:

Then there exists a set of transactions T0, T1 ... Tn−1 which obey 2PL and which produce a nonserializable schedule. A non-serializable schedule implies a cycle in the precedence graph, and we shall show that 2PL cannot produce such cycles.

Without loss of generality, assume the following cycle exists in the precedence graph: T0 → T1 → T2 → ... → Tn−1 → T0. Let αi be the time at which Ti obtains its last lock (i.e. Ti’s lock point).

Then for all transactions such that Ti → Tj , αi < αj . Then for the cycle we have α0 < α1 < α2 < ... < αn−1 < α0 Since α0 < α0 is a contradiction, no such cycle can exist. Hence 2PL cannot produce non-serializable schedules.

Because of the property that for all transactions such that Ti → Tj , αi < αj , the lock point ordering of the transactions is also a topological sort ordering of the precedence graph. Thus transactions can be serialized according to their lock points


Related Solutions

Using a 5-bit version of booth algorithm, multiple 13 and -2. Verify your answer. please show...
Using a 5-bit version of booth algorithm, multiple 13 and -2. Verify your answer. please show all your steps
Use the multi-layer perceptron algorithm to learn a model that classifies IRIS flower dataset. Split the...
Use the multi-layer perceptron algorithm to learn a model that classifies IRIS flower dataset. Split the dataset into a train set to train the algorithm and test set to test the algorithm. Calculate the accuracy. Use Scikit-Learn
Please answer in C++ Thanks! Use an istream_iterator, the copy algorithm and a back_inserter to read...
Please answer in C++ Thanks! Use an istream_iterator, the copy algorithm and a back_inserter to read the contents of a text file that contains int values separated by whitespace. Place the int values into a vector of ints. The first argument to the copy algorithm should be the istream_iterator object that's associated with the text file's ifstream object. The second argument should be the istream_iterator object that's initialized using the class template istream_iterator's default constructor-- the resulting object can be...
1. Read 20 integers into an array. Next, use the unique algorithm to reduce the array...
1. Read 20 integers into an array. Next, use the unique algorithm to reduce the array to the unique values entered by the user. Use the copy algorithm to display the unique values. 2. Modify the Exercise 1 above to use the unique_copy algorith. The unique values should be inserted into a vector that's initially empty. Use a back_inserter to enable the vector to grow as new items are added. Use the copy algorithm to display the unique values.
1. On a Profit & Loss statement, you wish to show only line items with transactions...
1. On a Profit & Loss statement, you wish to show only line items with transactions for the period. How can you do this? A. Filter the report for amounts greater than zero. B. Select the Advanced Option titled Include In Use. C. Collapse the report to show just parent accounts. D. Select the Advanced Option titled Display Rows > Active. 2. You want to see the line “See Accompanying Notes” at the bottom of the Profit & Loss statement....
Show the effect of the following transactions of Avis Services on the accounting equation. Use “+”...
Show the effect of the following transactions of Avis Services on the accounting equation. Use “+” to denote an increase, “–” to denote a decrease and “0” to denote no change to the elements of the equation. Copy the table in your answer book and follow the example given. The business uses the periodic inventory system. ■ Assume that the bank balance is favourable at all times. Example: Paid the insurance premium by cheque, R500 ASSETS EQUITY LIABILITIES No. Equipment...
All necessary steps much show for these problems, please. Use the Euclidean algorithm to find gcd(12345,...
All necessary steps much show for these problems, please. Use the Euclidean algorithm to find gcd(12345, 54321). Write gcd(2420, 70) as a linear combination of 2420 and 70. The work to obtain the gcd is provided. 2420 = 34(70) + 40 70 = 1(40) + 30 40 = 1(30) + 10 30 = 3(10) + 0 Determine if 1177 is prime or not. If it is not, then write 1177 as a product of primes Find gcd(8370, 465) by unique...
USE EXCEL ONLY AND SHOW FORMULAS PLEASE! An office building is purchased with the following projected...
USE EXCEL ONLY AND SHOW FORMULAS PLEASE! An office building is purchased with the following projected cash flows: • NOI is expected to be $130,000 in year 1 with 5 percent annual increases. • The purchase price of the property is $720,000. • 100 percent equity financing is used to purchase the property. • The property is sold at the end of year 4 for $860,000 with selling costs of 4 percent. • The required unlevered rate of return is...
Code in Java, Use both Set and TreeSet in only one main to show the differences...
Code in Java, Use both Set and TreeSet in only one main to show the differences between the Set and TreeSet that Set still remove the duplicate but won't sort the elements. Create a class named DictionaryWord as: DictionaryWord - word: String                                                              - meanings: String + DictionaryWord (String word, String meanings) + getWord(): String + setWord (String word): void + getMeanings(): String + setMeanings(String meanings): void Write a program with the following requirements: Creates 8 DictionaryWord objects with: Word...
Journalize the March transactions. Use only accounts from the company's chart of accounts, which are cash,...
Journalize the March transactions. Use only accounts from the company's chart of accounts, which are cash, accounts receivable, prepaid insurance, equipment, accumulated depreciation-equipment, accounts payable, salaries payable, unearned service revenue, common stock, retained earnings, dividends, income summary, service revenue, salaries expense, utilities expense, insurance expense and depreciation expense. Omit journal entry descriptions. Mar. 2 Stockholders invested $68,500 cash in the business in exchange for common stock of the corporation. Mar. 3 Purchased equipement for $42,800 cash. Mar. 6 Purchased a...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT