Recoverability of schedules - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Recoverability of schedules

Description:

3. Strict schedules. Transaction cannot R or W to X until last T that W(X) commits or aborts ... Can have schedules that are serializable, but not recoverable ... – PowerPoint PPT presentation

Number of Views:477
Avg rating:3.0/5.0
Slides: 15
Provided by: susanv5
Category:

less

Transcript and Presenter's Notes

Title: Recoverability of schedules


1
  • Recoverability of schedules

2
Recoverability of Schedules
  • How to ensure schedules are recoverable?
  • Once a T is committed, never have to roll it
    back
  • 3 types of recoverability
  • Recoverable schedules
  • Avoid cascading abort schedules
  • Strict schedules

3
Definition
  • T reads from T' if  T' writes to X before it is
    read by T
  • T' should not abort before T reads X,
  • there is no Ti that writes after T', but before T
    reads (unless Ti aborts before T reads)

4
1. Recoverable schedules
  • A schedule is recoverable if
  • If no transaction T in S commits until all
    transactions T' that have written an item that T
    reads have committed

5
Example
  • R1(X)W1(X)R2(X)R1(Y)W2(X)C2C1
  •    Is this schedule recoverable?
  • What if
  • R1(X)W1(X)R2(X)R1(Y)W2(X)C2A1

6
Example
  • R1(X)W1(X)R2(X)R1(Y)W2(X)C2A1
  • T2 reads X from T1, T2 commits before T1
  • If T1 aborts, the value of X is no longer valid
  • T2 cannot be aborted after it commits
  • Not recoverable
  • Must postpone C2 until C1

7
Recoverable Schedules
  • R1(X)W1(X)R2(X)R1(Y)W2(X)W1(Y)(A1or C1)C2  
  • this is recoverable
  • But, any problems?
  • Cascading rollback
  • uncommitted transaction rollback because read an
    item from a transaction that failed
  • T2 rolled back because it read X from T1, then T1
    aborted

8
2. Avoid cascading rollback schedules
  • Schedules to avoid cascading rollback
  • T only reads data written by committed
    transactions
  • This is stricter than recoverable
  • Before R2(X), wait until C1 
  •   R1(X)W1(X)R1(Y)W1(Y)C1R2(X)W2(X)C2
  • this avoids cascading abort
  • less concurrency

9
3. Strict schedules
  • Transaction cannot read or write to X until last
    T that W(X) commits or aborts
  • The "or write" makes it more restrictive
  • Simplifies the process of recovering write
    operations - just restore the before image of X
  • This has to do with logs, etc.  Will discuss
    later

10
Example
  • Is this strict?
  • W1(X) W2(X) C1 C2
  • no cascading aborts but not strict
  • T2 doesn't wait to write until C1
  • Did not read, just writes to X
  • This is strict
  • W1(X) C1 W2(X) C2

11
Recoverability summary
  • 1.  Recoverable - don't commit T until all T'
    written to an item that T reads have committed
  • 2.  Avoids Cascading Abort - T reads only data
    written by committed transactions
  • 3.  Strict - T cannot R or W to X until last T'
    that W(X) commits or aborts
  • Correctness? 
  • Still need serializability to see if correct

12
Recoverable and Serializable
  • Can have schedules that are serializable, but not
    recoverable
  • Can have schedules that are recoverable, but not
    serialiable
  • Can be both
  • Can be neither

13
Example - both
  • Strict TO - ensures strict schedules and conflict
    serializability
  • if T issues R(X) or W(X),
  • s.t. TS(T) gt W_TS(X)
  • R,W operation delayed until T that wrote to
    value of X committed or aborted
  • to implement, must simulate locking of X, but
    doesn't cause deadlocks

14
Which are these?
  • W3(X) R1(X) R2(X) W1(X) W1(Y) W2(X) W2(Y) C1C3C2
  • W3(X) R1(X) R2(X) W1(X) W1(Y) W2(X) W2(Y) C3C1C2
  • W3(X) R1(X) W1(X) R2(X) W1(Y) W2(X) W2(Y) C1C3C2
  • W3(X) R1(X) W1(X) R2(X) W1(Y) W2(X) W2(Y) C3C1C2
  • W3(X) C3 R1(X) W1(X) W1(Y) C1 R2(X) W2(X) C2
  • W3(X) C3 R1(X) W1(X) R2(Z) W1(Y) C1 R2(X) W2(X)
    C2
  • W3(X) C3 R1(X) W1(X) W2(X) C1 C2
Write a Comment
User Comments (0)
About PowerShow.com