Skip to content
UoL CS Notes

Locks, Logging & Recovery

COMP207 Tutorials

This covers tutorial 4.

Add links to answers to this tutorial.

Locks

See the answers for tutorial 4 for this question.

Logging & Recovery

  1. Recovery with undo-logging:
    1. Change the value of $X$ on disk back to 10 and call abort for $T_1$ and $T_2$.
    2. Change:
      • $Z=30$
      • $X=10$

      on disk and call abort for $T_1$.

    3. Same as 2 but also change:

      • $V=50$
    4. No change all transactions completed successfully.
  2. Values on disk:
    1. $X$ might be on disk.
    2. All values from $T_2$ must be on disk and $X$ and $Z$ might be on disk from $T_1$.
    3. All values from $T_2$ must be on disk and $X$, $V$ and $Z$ might be on disk from $T_1$.
    4. All values must be on disk.
  3. For the schedules in the tutorial:
    1. The following transactions need to be rolled back:
      • $S_1$ - $T_3$
      • $S_2$ - $T_2$
      • $S_3$ - None
      • $S_4$ - $T_3$

      You should roll back any transactions with dirty reads. You should also roll back any other transaction that reads a write created by a transaction that has had a dirty read.

      Dirty reads are where a transaction is allowed to read a row that has been modified by an another transaction which is not committed yet.

    2. This question is tedious due to the number of combinations. See the answers.