CS 430: Database Management Systems


Due Date - 11:59PM Sunday, July 30st
NO LATE PERIOD


Homework Assignment 5

  1. (12 points) Consider the following actions taken by transaction T1 on database objects X and Y : R(X), W(X), W(Y)
    1. Give an example of another transaction T2 that, if run concurrently to transaction T without some form of concurrency control, could interfere with T1.
    2. Explain how the use of Strict 2PL would prevent interference between the two transactions.
    3. Strict 2PL is used in many database systems. Give two reasons for its popularity.

  2. (36 points) Consider the following classes of schedules: conflict-serializable(a), recoverable(b), and avoids-cascading-aborts (c). For each of the following schedules, state which of the preceding classes it belongs to. If you cannot decide whether a schedule belongs in a certain class based on the listed actions, explain briefly.
    The actions are listed in the order they are scheduled and prefixed with the transaction name. If a commit or abort is not shown, the schedule is incomplete; assume that abort or commit must follow all the listed actions.
    For simplicity, you should answer the questions in the following way. For example, you say a schedule is conflict-serializable(a), but not recoverable(b), and cannot decide avoids-cascading-aborts (c),
    Your answer is: YNU, where Y is Yes, N is No, U is unknown. 36 pts
    1. T1:R(X), T2:R(X), T1:W(X), T2:W(X)
    2. T1:W(X), T2:R(Y), T1:R(Y), T2:R(X)
    3. T1:R(X), T2:R(Y), T3:W(X), T2:R(X), T1:R(Y)
    4. T1:R(X), T1:R(Y), T1:W(X), T2:R(Y), T3:W(Y), T1:W(X), T2:R(Y)
    5. T1:R(X), T2:W(X), T1:W(X), T2:Abort, T1:Commit
    6. T1:R(X), T2:W(X), T1:W(X), T2:Commit, T1:Commit
    7. T1:W(X), T2:R(X), T1:W(X), T2:Abort, T1:Commit
    8. T1:W(X), T2:R(X), T1:W(X), T2:Commit, T1:Commit
    9. T1:W(X), T2:R(X), T1:W(X), T2:Commit, T1:Abort
    10. T2: R(X), T3:W(X), T3:Commit, T1:W(Y), T1:Commit, T2:R(Y), T2:W(Z), T2:Commit
    11. T1:R(X), T2:W(X), T2:Commit, T1:W(X), T1:Commit, T3:R(X), T3:Commit
    12. T1:R(X), T2:W(X), T1:W(X), T3:R(X), T1:Commit, T2:Commit, T3:Commit

  3. (20 points)
    Sequence S1: T1:R(X), T2:W(X), T2:W(Y), T3:W(Y), T1:W(Y), T1:Commit, T2:Commit, T3:Commit
    Sequence S2: T1:R(X), T2:W(Y), T2:W(X), T3:W(Y), T1:W(Y), T1:Commit, T2:Commit, T3:Commit
    For each sequence and for each of the following concurrency control mechanisms, describe how the concurrency control mechanism handles the sequence.
    Assume that the timestamp of transaction Ti is i. For lock-based concurrency control mechanisms, add lock and unlock requests to the previous sequence of actions as per the locking protocol. The DBMS processes actions in the order shown. If a transaction is blocked, assume that all its actions are queued until it is resumed; the DBMS continues with the next action (according to the listed sequence) of an unblocked transaction.
    1. Strict 2PL with timestamps used for deadlock prevention (using Wait-Die policy).
    2. Strict 2PL with deadlock detection. (Show the waits-for graph in case of deadlock.)
    3. Optimistic concurrency control.
    4. Timestamp concurrency control with buffering of reads and writes (to ensure recoverability) and the Thomas Write Rule.
    5. Multiversion timestamp concurrency control.

  4. (16 points) Briefly answer the following questions:
    1. What are the properties required of LSNs?
    2. What are the fields in an update log record? Explain the use of each field.
    3. What are redoable log records?
    4. What are the differences between update log records and CLRs?

  5. (16 points) Consider the execution shown in the figure.
    1. Extend the figure to show prevLSN and undonextLSN values.
    2. Describe the actions taken to rollback transaction T2.
    3. Show the log after T2 is rolled back, including all prevLSN and undonextLSN values in log records.

These homework solutions must be checked into Canvas in .pdf format



Copyright © 2016: Colorado State University for CS 430. All rights reserved.