Algorithm Search⌘K

Definitioncore

Cascadeless schedule

Also called ACA schedule, avoiding cascading aborts.

A schedule in which transactions read only values written by committed transactions, so one abort never forces another.

A schedule avoids cascading aborts (ACA), or is cascadeless, if every transaction reads only values that committed transactions wrote, apart from its own writes. Then the abort of one transaction never forces the abort of another. The class lies strictly between the recoverable and the strict schedules of Hadzilacos (1988). In SQL terms, an ACA schedule has no dirty reads; it does not stop dirty writes, which is the extra step that strictness takes.

Definition

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). A schedule SS avoids cascading aborts if for all i≠ji \ne j and every item xx:

Ti reads x from Tj in S  ⟹  cj<Sri(x).T_i \text{ reads } x \text{ from } T_j \text{ in } S \implies c_j <_S r_i(x).

ACA denotes the class. The condition is on each read at the moment it happens, not on commits: a transaction may not read a value whose writer is still active.

Cascading aborts. In a schedule outside ACA, an abort can spread. In

S=w1(x) r2(x) w2(y) r3(y) a1,S = w_1(x)\ r_2(x)\ w_2(y)\ r_3(y)\ a_1,

T2T_2 read xx from T1T_1, so after a1a_1 the value that T2T_2 saw does not exist, and T2T_2 must abort. T3T_3 read yy from T2T_2, so it must abort as well. SS is recoverable, since nothing has committed, so the cascade is legal, but it wastes the work of T2T_2 and T3T_3, and the chain can be as long as the number of active transactions.

Claim. If SS is in ACA and an active transaction TjT_j aborts, no other transaction must abort. Proof. A transaction must abort only if it read from a transaction that aborts. In ACA, if TiT_i reads from TjT_j, then cj∈Sc_j \in S, so TjT_j is not active. Therefore no transaction read from TjT_j, and the cascade has no first step. □\square

ACA is inside RC, and the inclusion is strict. Proof. Let S∈S \in ACA, and let TiT_i read xx from TjT_j with ci∈Sc_i \in S. Then cj<Sri(x)<Scic_j <_S r_i(x) <_S c_i, which is the condition of recoverability. The schedule w1(x) r2(x) c1 c2w_1(x)\ r_2(x)\ c_1\ c_2 is recoverable but T2T_2 reads xx before c1c_1, so it is not in ACA. □\square

Basic facts.

  • Prefix closed. Whether a read satisfies the condition depends only on the actions before it, so every prefix of an ACA schedule is in ACA.
  • How a scheduler gets ACA. It delays every read ri(x)r_i(x) until the last writer of xx that is still active has committed or aborted. Strict two-phase locking does this, and more, by holding exclusive locks until the end of the transaction.
  • Independent of serializability. An ACA schedule need not be conflict serializable, and a serial order of the committed work does not give ACA. The recoverable schedule page has one example for each combination.

Examples and non-examples

Examples.

  • w1(x) c1 r2(x) c2w_1(x)\ c_1\ r_2(x)\ c_2 is in ACA: T2T_2 reads xx after c1c_1.
  • w1(x) r1(x) c1w_1(x)\ r_1(x)\ c_1 is in ACA: a transaction may read its own uncommitted write. The definition asks i≠ji \ne j.
  • w1(x) w2(x) c1 c2w_1(x)\ w_2(x)\ c_1\ c_2 is in ACA, because nothing is read, but it is not strict: T2T_2 overwrites xx while T1T_1 is active. If T1T_1 aborted, restoring the old value of xx would also erase the write of T2T_2.
  • r1(x) w2(x) w1(x) c1 c2r_1(x)\ w_2(x)\ w_1(x)\ c_1\ c_2 is in ACA but not conflict serializable: the conflict graph has T1→T2T_1 \to T_2 from r1(x)r_1(x) and w2(x)w_2(x), and T2→T1T_2 \to T_1 from the two writes.

Non-examples.

  • w1(x) r2(x) c1 c2w_1(x)\ r_2(x)\ c_1\ c_2 is recoverable but not in ACA: T2T_2 reads xx while T1T_1 is active, and it would have to abort if T1T_1 did.
  • w1(x) w2(x) a2 r3(x) c1 c3w_1(x)\ w_2(x)\ a_2\ r_3(x)\ c_1\ c_3 is not in ACA. After a2a_2, the write of T2T_2 no longer counts, so T3T_3 reads xx from T1T_1, which is still active. The abort of T2T_2 does not make the read safe.
  • w1(x) w2(y) r1(y) c2 c1w_1(x)\ w_2(y)\ r_1(y)\ c_2\ c_1 is not in ACA, although it is serializable: r1(y)r_1(y) comes before c2c_2.

All schedules of two increments. Let T1=r1(x) w1(x) c1T_1 = r_1(x)\ w_1(x)\ c_1 and T2=r2(x) w2(x) c2T_2 = r_2(x)\ w_2(x)\ c_2. Of the 20 complete schedules, 14 are in ACA, but only the two serial schedules are in ACA and conflict serializable at the same time. In the other twelve ACA schedules both transactions read xx before either writes it, which is the lost update. So ACA protects against aborts, and gives nothing against bad interleavings.

  • Recoverable schedules (RC) only ask that a reader commit after its writer. They allow cascades, but never a committed transaction that must be undone.
  • Strict schedules (ST) also forbid overwriting an item whose last writer is active. Then an abort can be undone by restoring before images. ST is strictly inside ACA.
  • Read committed. The isolation level READ COMMITTED forbids dirty reads, which is the ACA condition. Most systems get it by short read locks or by reading the last committed version.
  • Transaction anomalies. The dirty read (P1 in the ANSI critique) is the pattern that ACA rules out; the dirty write (P0) is the pattern that ST also rules out.
  • Crash recovery aborts all active transactions after a crash. With ACA, these aborts do not reach any transaction that committed or that survives.

References

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

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/E7X2PT/text.yaml