Algorithm Search⌘K

Definitioncore

Strict schedule

Also called strictness of schedules.

A schedule in which no item is read or overwritten until the last transaction that wrote it has committed or aborted.

A schedule is strict (ST) if no transaction reads or writes an item while another transaction that wrote the item earlier is still active. It is the smallest of the three recovery classes of Hadzilacos (1988): every strict schedule avoids cascading aborts and is recoverable. Its practical value is that an abort can be done physically, by writing back the old value of every item that the transaction wrote. Most lock based systems produce strict schedules, because strict two-phase locking does.

The word "strict" here is about aborts. It is not the same as strict serializability, which is serializability plus the real-time order of transactions that do not overlap; see external consistency and linearizability.

Definition

Definition (Hadzilacos 1988). A schedule SS is strict if for all i≠ji \ne j, every item xx and every action oi(x)∈{ri(x),wi(x)}o_i(x) \in \{r_i(x), w_i(x)\}:

wj(x)<Soi(x)  ⟹  aj<Soi(x) or cj<Soi(x).w_j(x) <_S o_i(x) \implies a_j <_S o_i(x) \text{ or } c_j <_S o_i(x).

ST denotes the class.

The last writer is enough. The summary speaks of the last writer of xx. The two forms are the same. Proof. The definition implies the last-writer form at once. For the other direction, assume the last-writer form. We show the definition for oi(x)o_i(x) by induction on its position in SS. Let wj(x)<Soi(x)w_j(x) <_S o_i(x) with i≠ji \ne j, and let wk(x)w_k(x) be the last write of xx before oi(x)o_i(x). If k=jk = j, the last-writer form says that TjT_j ended before oi(x)o_i(x). If k≠jk \ne j, then wj(x)<Swk(x)<Soi(x)w_j(x) <_S w_k(x) <_S o_i(x), and wk(x)w_k(x) is an earlier action of a transaction other than TjT_j. By the induction hypothesis for wk(x)w_k(x), TjT_j ended before wk(x)w_k(x), so also before oi(x)o_i(x). □\square

ST is inside ACA, and the inclusion is strict. Proof. If TiT_i reads xx from TjT_j, then wj(x)<Sri(x)w_j(x) <_S r_i(x) and TjT_j has not aborted before ri(x)r_i(x). Strictness gives cj<Sri(x)c_j <_S r_i(x), which is the ACA condition. The schedule w1(x) w2(x) c1 c2w_1(x)\ w_2(x)\ c_1\ c_2 reads nothing, so it is in ACA, and it is not strict. □\square

Recovery by before images. The before image of wj(x)w_j(x) is the value of xx just before that write. Undo aja_j by writing back the before images of the writes of TjT_j, last write first. Claim: if S ajS\,a_j is strict, this gives every item the value of its last write by a transaction that did not abort, or its initial value if there is none. Proof sketch. Fix xx and the first write wj(x)w_j(x) of TjT_j. By strictness, every earlier writer of xx ended before wj(x)w_j(x), so (by induction on the number of aborts) the value just before wj(x)w_j(x) is the last write of xx by a committed transaction, or the initial value. By strictness again, no other transaction writes xx between wj(x)w_j(x) and aja_j. So restoring the before image of the first write of TjT_j, which the reverse order does last, gives the right value. □\square

Without strictness this fails. Take x=1x = 1 and w1(x=2) w2(x=3) a1 a2w_1(x{=}2)\ w_2(x{=}3)\ a_1\ a_2. The undo of T1T_1 writes back 11, and the undo of T2T_2 then writes back 22, the value of an aborted transaction. The right final value is 11.

Basic facts.

  • Prefix closed. The condition on an action depends only on the actions before it.
  • How a scheduler gets ST. Hold every exclusive lock until commit or abort, as strict two-phase locking does. Then any oi(x)o_i(x) after wj(x)w_j(x) needs a lock that conflicts with the exclusive lock of TjT_j, and it gets that lock only after TjT_j has ended. Read locks may be released earlier.
  • Not a serializability condition. A strict schedule need not be conflict serializable. Strict two-phase locking gives both, because the two-phase rule gives serializability and the long exclusive locks give strictness.

Examples and non-examples

Examples.

  • w1(x) c1 r2(x) w2(x) c2w_1(x)\ c_1\ r_2(x)\ w_2(x)\ c_2 is strict.
  • r1(x) w2(x) c1 c2r_1(x)\ w_2(x)\ c_1\ c_2 is strict: a write after a read of an active transaction is allowed. The condition only looks at earlier writes.
  • r1(x) r2(x) w1(x) c1 w2(x) c2r_1(x)\ r_2(x)\ w_1(x)\ c_1\ w_2(x)\ c_2 is strict and is a lost update. With 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, six of the 20 complete schedules are strict, and four of them are not conflict serializable.
  • 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 is strict but not conflict serializable: T1→T2T_1 \to T_2 on xx and T2→T1T_2 \to T_1 on yy.

Non-examples.

  • w1(x) w2(x) c1 c2w_1(x)\ w_2(x)\ c_1\ c_2 is in ACA but not strict: T2T_2 overwrites xx while T1T_1 is active. This is the dirty write.
  • w1(x) r2(x) c1 c2w_1(x)\ r_2(x)\ c_1\ c_2 is recoverable, not in ACA and so not strict.
  • w1(x) w1(y) w2(y) c1 c2w_1(x)\ w_1(y)\ w_2(y)\ c_1\ c_2 is not strict, although no transaction reads anything and the schedule is serializable.
  • Cascadeless schedules (ACA) forbid only the dirty read. Recoverable schedules (RC) only order the commits. ST ⊂\subset ACA ⊂\subset RC.
  • Rigorous schedules (Breitbart, Georgakopoulos, Rusinkiewicz and Silberschatz 1991) add the mirror rule for reads: if rj(x)<Swi(x)r_j(x) <_S w_i(x) with i≠ji \ne j, then TjT_j ended before wi(x)w_i(x). So no two conflicting actions of active transactions ever overlap. A rigorous schedule is strict, and its committed projection is conflict serializable in commit order. Proof. For committed Ti,TjT_i, T_j and conflicting actions pj<Sqip_j <_S q_i, rigor gives cj<Sqi<Scic_j <_S q_i <_S c_i. So every arc of the conflict graph goes from the earlier to the later commit, and the commit order is a topological order. □\square Strong strict two-phase locking, which holds all locks until the end, produces rigorous schedules. The same argument shows that rigorous schedules satisfy commitment ordering: conflicting committed transactions commit in the order of their conflicts.
  • Strict serializability has nothing to do with this class. It is serializability in an order that respects real time, the database analogue of linearizability.
  • Undo logs and write-ahead logging store before images. Strictness is what makes those before images enough to undo an aborted transaction at the item level.

References

  1. Vassos Hadzilacos, A theory of reliability in database systems, Journal of the ACM 35(1), 1988, pages 121 to 145, strict histories, their place inside the cascadeless class, and recovery by before images
  2. Philip A. Bernstein, Vassos Hadzilacos and Nathan Goodman, Concurrency Control and Recovery in Database Systems, Addison-Wesley, 1987, Chapter 1 (strict executions and before images) and Chapter 2 (strict histories)
  3. Yuri Breitbart, Dimitrios Georgakopoulos, Marek Rusinkiewicz and Abraham Silberschatz, On rigorous transaction scheduling, IEEE Transactions on Software Engineering 17(9), 1991, pages 954 to 960, the definition of rigorous schedules and their properties

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