Algorithm Search⌘K

Definitioncore

Recoverable schedule

Also called recoverability.

A schedule in which each transaction commits only after every transaction whose writes it read has committed.

A schedule is recoverable (RC) if no transaction commits before every transaction it read from has committed. It is the weakest of the three recovery classes of Hadzilacos (1988), with cascadeless and strict schedules inside it. Recoverability is about aborts, not about interleaving: serializability looks only at the committed projection, so a serializable schedule can still let a committed transaction keep a value that an abort later erases. A recoverable schedule never needs to undo a commit, which the D of the ACID properties forbids.

Definition

Let SS be a schedule, and use the reads-from relation of the schedule page: TiT_i reads xx from TjT_j (i≠ji \ne j) if wj(x)<Sri(x)w_j(x) <_S r_i(x), TjT_j has not aborted before ri(x)r_i(x), and every write of xx between them belongs to a transaction that aborted before ri(x)r_i(x).

Definition (Hadzilacos 1988). SS is recoverable if for all i≠ji \ne j:

Ti reads some item from Tj in S and ci∈S  ⟹  cj∈S and cj<Sci.T_i \text{ reads some item from } T_j \text{ in } S \text{ and } c_i \in S \implies c_j \in S \text{ and } c_j <_S c_i.

RC denotes the class of recoverable schedules.

Why the condition is the right one. Assume that SS is recoverable and that the active transaction TjT_j aborts now, so the schedule becomes S ajS\,a_j. Every transaction that read from TjT_j has seen a value that no longer exists, so it must abort too, and so must every transaction that read from one of those, and so on. Claim: in a recoverable SS, none of these transactions is committed. Proof. Let Tj=Tk0,Tk1,…,TkmT_j = T_{k_0}, T_{k_1}, \ldots, T_{k_m} be a chain in which each TktT_{k_t} reads from Tkt−1T_{k_{t-1}}. We show by induction on tt that TktT_{k_t} is not committed. For t=0t = 0, TjT_j is active. If Tkt−1T_{k_{t-1}} is not committed and TktT_{k_t} were committed, the definition would need ckt−1∈Sc_{k_{t-1}} \in S, a contradiction. □\square

So in a recoverable schedule every abort can be completed by aborting active transactions only. In a schedule that is not recoverable, some abort would require undoing a commit.

Basic facts.

  • Prefix closed. If SS is recoverable, so is every prefix S′S'. The reads-from pairs of S′S' are those of SS whose read lies in S′S', since they depend only on the actions before the read. If ci∈S′c_i \in S', then cj<Scic_j <_S c_i, so cjc_j is also in S′S'.
  • A scheduler enforces RC by delaying commits. Every schedule without commits is recoverable. A scheduler can let TiT_i read uncommitted data, and then hold back cic_i until all the transactions that TiT_i read from have committed. If one of them aborts, it aborts TiT_i instead.
  • Inclusions. ST ⊂\subset ACA ⊂\subset RC, and both inclusions are strict. The proof of the inclusions is on the serializability page; the examples below show that they are strict.
  • Independent of serializability. RC and the class of schedules whose committed projection is conflict serializable are incomparable. Every serial schedule is in both.

Examples and non-examples

The table gives one schedule for each region of the diagram of the classes RC, ACA (avoids cascading aborts) and ST (strict), crossed with conflict serializability (CSR) of the committed projection. Each row is in the classes marked "yes" and in no other class of the table.

schedule RC ACA ST CSR
w1(x) r2(x) c2 c1w_1(x)\ r_2(x)\ c_2\ c_1 no no no yes
w1(x) r2(x) w2(y) r1(y) c2 c1w_1(x)\ r_2(x)\ w_2(y)\ r_1(y)\ c_2\ c_1 no no no no
w1(x) r2(x) c1 c2w_1(x)\ r_2(x)\ c_1\ c_2 yes no no yes
w1(x) r2(x) r2(y) w1(y) c1 c2w_1(x)\ r_2(x)\ r_2(y)\ w_1(y)\ c_1\ c_2 yes no no no
w1(x) w2(x) c1 c2w_1(x)\ w_2(x)\ c_1\ c_2 yes yes no yes
r1(x) w2(x) w1(x) c1 c2r_1(x)\ w_2(x)\ w_1(x)\ c_1\ c_2 yes yes no no
w1(x) c1 r2(x) c2w_1(x)\ c_1\ r_2(x)\ c_2 yes yes yes yes
r1(x) r2(y) w1(y) w2(x) c1 c2r_1(x)\ r_2(y)\ w_1(y)\ w_2(x)\ c_1\ c_2 yes yes yes no

The dirty read that commits. In the first row, T2T_2 reads xx from T1T_1 and commits first. If T1T_1 now aborts, the database must erase the value of T1T_1, but T2T_2 is committed and may have shown that value to a user. The schedule is conflict equivalent to the serial schedule T1T2T_1 T_2, so serializability alone does not catch this.

Recoverable but with a cascade. In the third row, T2T_2 waits with its commit until T1T_1 has committed. Had T1T_1 aborted instead of committing, T2T_2 would have had to abort too. That is allowed in RC; the cascadeless class forbids it.

Recoverable but not serializable. In the fourth row, T2T_2 reads xx after w1(x)w_1(x) and reads yy before w1(y)w_1(y). The conflict graph has the cycle T1→T2→T1T_1 \to T_2 \to T_1, but the commit order is correct for the only reads-from pair.

Reads-from across an abort. w1(x) w2(x) r3(x) a2 c1 c3w_1(x)\ w_2(x)\ r_3(x)\ a_2\ c_1\ c_3 is not recoverable: T3T_3 reads xx from T2T_2, because a2a_2 comes after the read, and T3T_3 commits although T2T_2 never does. The variant w1(x) w2(x) a2 r3(x) c1 c3w_1(x)\ w_2(x)\ a_2\ r_3(x)\ c_1\ c_3 is recoverable: after the abort, T3T_3 reads xx from T1T_1, which commits before T3T_3.

Not a property of the committed projection. The committed projection of w1(x) r2(x) a1 c2w_1(x)\ r_2(x)\ a_1\ c_2 is r2(x) c2r_2(x)\ c_2, which is recoverable. The schedule itself is not. Recoverability must be checked on the full schedule, with its aborts.

  • Cascadeless schedules (ACA) ask more: a transaction reads only committed data. Then an abort never forces another abort.
  • Strict schedules (ST) ask more again: no item is read or overwritten while its last writer is still active. Then the abort of a transaction is undone by writing back the before images of its writes. Strict two-phase locking produces strict schedules.
  • Two-phase locking in its basic form gives conflict serializable schedules that need not be recoverable: a transaction may release an exclusive lock after its lock point and before its commit, and another transaction may read the item and commit first.
  • Commitment ordering is a different condition on commit order: it orders the commits of conflicting transactions in the order of their conflicts. It is about serializability, not about aborts.
  • Crash recovery handles the aborts of all transactions that were active at a crash. Recoverability of the schedule is what makes that possible without touching committed work.

References

  1. Vassos Hadzilacos, A theory of reliability in database systems, Journal of the ACM 35(1), 1988, pages 121 to 145, the recoverable, cascadeless and strict classes of histories and their inclusions
  2. Philip A. Bernstein, Vassos Hadzilacos and Nathan Goodman, Concurrency Control and Recovery in Database Systems, Addison-Wesley, 1987, Chapter 1 (recoverability, cascading aborts, strict executions) and Chapter 2 (recoverable histories)
  3. Gerhard Weikum and Gottfried Vossen, Transactional Information Systems, Morgan Kaufmann, 2001, the chapter on transaction recovery (the classes RC, ACA, ST and rigorousness)

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/G0MPST/text.yaml