# Examples by gjjur4356

VIEWS: 21 PAGES: 7

• pg 1
```									  Examples

Undo, Redo, Undo/Redo
<START S>
Undo Log
<S,A,60>              •   Suppose that we begin a non
<COMMIT S>                quiescent checkpoint immediately
<START T>                 after <T,A,10>
<T,A,10>              •   Tell,
<START CKPT (T)>          1. When the <END CKPT> is
<START U>                       written?
<U,B,20>                  2. For each possible point at
<T,C,30>                        which a crash could occur, how
far back in the log we must look
<START V>                       to find all the possible
<U,D,40>                        incomplete transactions?
<V,F,70>
<COMMIT U>
<T,E,50>
<COMMIT T>
<V,B,80>
<COMMIT V>
<START S>
Undo Log
<S,A,60>              •    Suppose that we begin a non quiescent
checkpoint immediately after <T,A,10>
<COMMIT S>
•    Tell,
<START T>
1. When the <END CKPT> is written?
<T,A,10>                   2. For each possible point at which a
<START CKPT (T)>                 crash could occur, how far back in
<START U>                        the log we must look to find all the
possible incomplete transactions?
<U,B,20>
<T,C,30>              1.   If the crash occurs after <END CKPT>,
<START V>                  we have to search back only to the
<U,D,40>                   <START CKPT(T)>.
2.   However, for crashes prior to the
<V,F,70>
<COMMIT T> record, the search must
<COMMIT U>                 continue back as far as the <START T>
<T,E,50>                   record, since that is the (lone)
transaction that was active at the start
<COMMIT T>                 of the checkpoint.
<END CKPT>
<V,B,80>
<COMMIT V>
<START S>
Redo Log
<S,A,60>              •   Suppose that we begin a non
<COMMIT S>                quiescent checkpoint immediately
<START T>                 after <T,A,10>
<T,A,10>              •   Tell,
<START CKPT (T)>          1. When the <END CKPT> is
<START U>                       written?
<U,B,20>                  2. For each possible point at
<T,C,30>                        which a crash could occur, how
far back in the log we must look
<START V>                       to find all the possible
<U,D,40>                        incomplete transactions?
<V,F,70>
<COMMIT U>
<T,E,50>
<COMMIT T>
<V,B,80>
<COMMIT V>
<START S>
Redo Log
<S,A,60>              •    Suppose that we begin a non quiescent
checkpoint immediately after <T,A,10>
<COMMIT S>
•    Tell,
<START T>                  1. When the <END CKPT> could be
<T,A,10>                         written?
<START CKPT (T)>           2. For each possible point at which a crash
could occur, how far back in the log we
<START U>                        must look to find all the possible
incomplete transactions? Consider both
<U,B,20>                         the case that the <END CKPT> record
<T,C,30>                         was or was not written prior to the
crash.
<START V>
<U,D,40>              1.   <END CKPT> can occur at any point after
<V,F,70>                   the <START CKPT(T)>.
<COMMIT U>            2.   If the crash occurs after <END CKPT>, we
restrict ourselves only to committed
<T,E,50>                   transactions that were listed in <START
CKPT(..)>, i.e. T, and those that started after
<COMMIT T>                 this point.
<V,B,80>              3.   If the crash occurs in between, then, for this
<COMMIT V>                 example, we have to consider all the log.
Undo/Redo Log
<START S>
<S,A,60,61>        •   Suppose that we begin a non
<COMMIT S>             quiescent checkpoint immediately
after <T,A,61,62>
<START T>
•   Tell,
<T,A,61,62>
1. When the <END CKPT> could
<START CKPT (T)>             be written?
<START U>              2. For each possible point at
<U,B,20,21>                  which a crash could occur, how
<T,C,30,31>                  far back in the log we must look
<START V>                    at?
<U,D,40,41>
<V,F,70,71>
<COMMIT U>
<T,E,50,51>
<COMMIT T>
<V,B,21,22>
<COMMIT V>
<START S>
Undo/Redo Log
<S,A,60,61>        •    Suppose that we begin a non
<COMMIT S>              quiescent checkpoint immediately
<START T>               after <T,A,61,62>
<T,A,61,62>        •    Tell,
<START CKPT (T)>        1. When the <END CKPT> could
<START U>                     be written?
<U,B,20,21>             2. For each possible point at
<T,C,30,31>                   which a crash could occur, how
far back in the log we must look
<START V>                     at?
<U,D,40,41>
<V,F,70,71>        1.   <END CKPT> can occur at any point after
<COMMIT U>              the <START CKPT(T)>.
2.   If the crash occurs after <END CKPT>, we
<T,E,50,51>             restrict ourselves only to transactions that
<COMMIT T>              were listed in <START CKPT(..)>, i.e. T, and
those that started after this point.
<V,B,21,22>        3.   If the crash occurs in between, then, for this
<COMMIT V>              example, we have to consider all the log.

```
To top