[20 points] After a system’s crash,
the undo-log using non-quiescent checkpointing contains the following
data:
a.
What are the correct values of the three <START CKPT
????> records ? You
have to provide three correct values for the three “????”s.
b.
Assuming that the three <START CKPT ???>
records are correctly stored in the log, according to your
answer at a., show which elements are recovered by the undo recovery
manager and compute their values after recovery.
<START T1> |
<T1 X1 55> |
<START T2> |
<T2 X2 99> |
<COMMIT T1> |
. . . . |
Is represented by the table:
N |
T |
E |
V |
0 |
T1 |
-1 |
|
1 |
T1 |
X1 |
55 |
2 |
T2 |
-1 |
|
3 |
T2 |
X2 |
99 |
4 |
T1 |
-2 |
|
. . . |
|
|
|
Recall that each transaction starts
and ends at
most once, i.e. a sequence <START T> … <COMMIT T> …
<START T>
… will not occur in the log. Moreover, any update by the transaction T
will
occur between its <START T> and <COMMIT T>, or between
<START
T> and <ABORT T> respectively.
Write a SQL query that can be run during database recovery, after a
system
crash. The answer to your query should return a table with two
attributes, E,
and V, indicating which elements have to be updated with what
values.
You should include each element E at most once in your answer:
otherwise
it would be ambiguous how to update it.
3.1. For each of the following schedules:
i. What is the precedence graph for the
schedule?
ii. Is the schedule confict-serializable? If so,
what are all the equivalent serial schedules?
Say that a transaction
T1 precedes a transaction T2 in a
schedule S, if every action of T1 precedes every action of
T2. Note that if the schedule consists only of the
transactions T1 and T2 and T1
precedes T2, then S is the serial schedule
T1;T2. However, if T1 precedes
T2 in S and S involves transactions other than
T1 and T2, then S may not be a serial schedule,
and may not even be serializable.
Consider a timestamp based
concurrency control manager: the manager assigns a unique time stamp
to each transaction, maintains for each element X the three values
RT(X), WT(X), C(X), and decides at each read/write request of a
transaction T whether to grant, to rollback,
to ignore, or to defer. Consider the partial schedules
below (where st means start transaction). What does the
concurrency control manager do for the last request in each schedule
?
Consider an optimistic
concurrency control manager (based on validation). We denote
Ri to mean "transaction Ti starts and performs
its read phase", Vi(X; Y) to "Ti attempts to
validate, its read set is X, its write set is Y", and Wi to
mean "Ti performs its write phase and finishes". For each
validation attempt below, indicate whether the validation, succeeds,
fails due to a R-W conflict, or fails due to a W-W conflict.