Properties of Schedules

COMP9315 21T1 ♢ Properties of Schedules ♢ [0/12]
❖ Schedule Properties

If a concurrent schedule on a set of tx's TT ...

A goal of isolation mechanisms (see later) is Serializability is one property of a schedule, focusing on isolation

Other properties of schedules focus on recovering from failures

COMP9315 21T1 ♢ Properties of Schedules ♢ [1/12]
❖ Serializable Schedules

Producing a serializable schedule

If DB programmers know update anomalies are unlikely/tolerable
COMP9315 21T1 ♢ Properties of Schedules ♢ [2/12]
❖ 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, but ...

Consider three places where the rollback might occur:

T1: R(X) W(X) A [1]     [2]        [3]
T2:                 R(X)    W(X) C

COMP9315 21T1 ♢ Properties of Schedules ♢ [3/12]
❖ 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

Case [2] is problematic Case [3] is also problematic
COMP9315 21T1 ♢ Properties of Schedules ♢ [4/12]
❖ Recoverability

Consider the serializable schedule:

T1:        R(X)  W(Y)  C
T2:  W(X)                 A

(where the final value of Y is dependent on the X value)

Notes:

Produces an invalid database state, even though serializable.
COMP9315 21T1 ♢ Properties of Schedules ♢ [5/12]
❖ Recoverability (cont)

Recoverable schedules avoid these kinds of problems.

For a schedule to be recoverable, we require additional constraints

and this property must hold for all transactions Tj

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.

COMP9315 21T1 ♢ Properties of Schedules ♢ [6/12]
❖ 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).

COMP9315 21T1 ♢ Properties of Schedules ♢ [7/12]
❖ 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 ...

COMP9315 21T1 ♢ Properties of Schedules ♢ [8/12]
❖ Cascading Aborts (cont)

Cascading aborts can be avoided if

Effectively: eliminate the possibility of reading dirty data  

Downside: reduces opportunity for concurrency  

GUW call these ACR (avoid cascading rollback) schedules.

All ACR schedules are also recoverable.

COMP9315 21T1 ♢ Properties of Schedules ♢ [9/12]
❖ Strictness


Strict schedules also eliminate the chance of writing  dirty data.

A schedule is strict if

Strict schedules simplify the task of rolling back after aborts.
COMP9315 21T1 ♢ Properties of Schedules ♢ [10/12]
❖ Strictness (cont)

Example: non-strict schedule

T1:  W(X)        A
T2:        W(X)     A

Problems with handling rollback after aborts:

COMP9315 21T1 ♢ Properties of Schedules ♢ [11/12]
❖ Classes of Schedules

Relationship between various classes of schedules:

[Diagram:Pics/txproc/schedules.png]

Schedules ought to be serializable and strict.

But more serializable/strict  less concurrency.

DBMSs allow users to trade off "safety" against performance.

COMP9315 21T1 ♢ Properties of Schedules ♢ [12/12]


Produced: 14 Apr 2021