❖ Schedule Properties |
If a concurrent schedule on a set of tx's TT ...
Other properties of schedules focus on recovering from failures
❖ Serializable Schedules |
Producing a serializable schedule
❖ Transaction Failure |
So far, have implicitly assumed that all transactions commit.
Additional problems can arise when transactions abort.
Consider the following schedule where transaction T1 fails:
T1: R(X) W(X) A T2: R(X) W(X) C
Abort will rollback the changes to X
Consider three places where the rollback might occur:
T1: R(X) W(X) A [1] [2] [3] T2: R(X) W(X) C
❖ Transaction Failure (cont) |
Abort / rollback scenarios:
T1: R(X) W(X) A [1] [2] [3] T2: R(X) W(X) C
Case [1] is ok
❖ Recoverability |
Consider the serializable schedule:
T1: R(X) W(Y) C T2: W(X) A
(where the final value of Y
X
Notes:
❖ Recoverability (cont) |
Recoverable schedules avoid these kinds of problems.
For a schedule to be recoverable, we require additional constraints
Note that recoverability does not prevent "dirty reads".
In order to make schedules recoverable in the presence of dirty reads and aborts, may need to abort multiple transactions.
❖ Cascading Aborts |
Recall the earlier non-recoverable schedule:
T1: R(X) W(Y) C T2: W(X) A
To make it recoverable requires:
T1: R(X) W(Y) ... C? A! T2: W(X) A
Known as cascading aborts (or cascading rollback).
❖ Cascading Aborts (cont) |
Example: T3 aborts, causing T2 to abort, causing T1 to abort
T1: R(Y) W(Z) A T2: R(X) W(Y) A T3: W(X) A
Even though T1 has no direct connection with T3 (i.e. no shared data).
This kind of problem ...
❖ Cascading Aborts (cont) |
Cascading aborts can be avoided if
(alternative formulation: no tx can read data items written by an uncommitted tx)
Downside: reduces opportunity for concurrency ✗
GUW call these ACR (avoid cascading rollback) schedules.
All ACR schedules are also recoverable.
❖ Strictness |
Strict schedules also eliminate the chance of writing dirty data.
A schedule is strict if
❖ Strictness (cont) |
Example: non-strict schedule
T1: W(X) A T2: W(X) A
Problems with handling rollback after aborts:
❖ Classes of Schedules |
Relationship between various classes of schedules:
Schedules ought to be serializable and strict.
But more serializable/strict ⇒ less concurrency.
DBMSs allow users to trade off "safety" against performance.
Produced: 14 Apr 2021