Information Technology Reference
In-Depth Information
Volatile Memory
Pending write−backs
Log−head pointer
Log−tail pointer
Persistent Storage
Log−head pointer
Log:
Mixed:
WB Complete
Committed
Uncommitted
Writeback
...
...
Free
Free
Complete
newer
older
Available for
New Records
Garbage Collected
Eligible for GC
In Use
Figure14.3: Volatile and persistent data structures for a transactional system
based on a replay log.
For concreteness, Figure 14.3 illustrates a transaction log with an area of
the log that is in use, an area that is no longer needed because it contains
only records for transactions whose writebacks have completed, and an
area that is free.
In this example system, the system's volatile memory maintains pointers
to the head and tail of the log, new transaction records are appended to
the tail of the log and cached in volatile memory, a write-back process
asynchronously writes pending write-backs for committed transactions to
their final locations in persistent storage, and a garbage collection process
periodically advances a persistent log-head pointer so that recovery can
skip at least some of the transactions whose writebacks are complete.
Example: New writes v. garbage collection.
Question: Suppose we have a circular log organized like the one in
Figure 14.3. We must ensure that new records do not
overwrite records that we may read during recovery, so we
must ensure that the log-tail does not catch the log-head.
But there are two log-heads, one in volatile memory and
another in persistent storage. Which log-head represents
the barrier that the log-tail must not cross?
Answer: The log-tail must not catch the persistent log-head pointer.
Even though the records between the persistent and volatile
log-heads have already been written back, during crash
recovery, the recovery process will begin reading the log
 
Search WWH ::




Custom Search