Please enable JavaScript.
Coggle requires JavaScript to display documents.
Recovery System - Coggle Diagram
Recovery System
Recovery and Atomicity
-
Database Modification
If a transaction does not modify the database until it has committed, it is said to use the deferred-modification technique
If database modifications occur while the transaction is still active, the transaction is said to use the immediate-modification technique.
The system has available both the old value prior to the modification of the data item and the new value that is to be written for the data item.
-
Transaction Commit
We say that a transaction has been committed when its commit record, which is the last record of the transaction, has been committed to stable storage.
-
Checkpoints
When a system crash occurs, we must consult the log to determine which transactions to redo and which to roll back.
Some disadvantajes
-
Most of the transactions that, according to our algorithm, need to be redone have already written their updates into the database.
Failure Classification
Transaction failure
Logical error
The transaction can no longer proceed normally execution due to some internal condition, such as bad input, data not found, overflow or resource limit exceeded.
System error
The system has entered an undesired state, so a transaction cannot continue its normal execution.
System crash
Hardware malfunction or error in the database software or operating system, causing the loss of volatile storage contents and halting transaction processing.
fail-stop assumption
hardware failures and software failures halt the system, but do not damage non-volatile storage contents
Disk failure
A disk block loses its contents as a result of a crash or head failure during a data transfer operation.
recovery algorithms have
Actions taken during normal transaction processing to ensure that there are sufficient information exists to enable recovery from failures.
Actions taken after a failure to recover the contents of the database to a state that guarantees database consistency, transaction atomicity, and durability.
-
Buffer Management
Log-Record Buffering
-
Multiple log records can be gathered in the log buffer and output to stable storage in a single output operation.
A log record may reside in only main memory for a considerable time before it is output to stable storage.
-
Database Buffering
-
no-force policy
allows a transaction to commit even if it has modified some
blocks that have not yet been written back to disk.
-
steal policy
allows the system to write changed blocks to disk even if not all the transactions that made those modifications have been committed.
-
-
-
Fuzzy Checkpointing
If the number of pages in the buffer is big, a checkpoint can take a long time to complete, which can cause an unacceptable interruption in transaction processing.
To avoid interruptions, the checkpointing technique can be modified to allow updates to start after the checkpoint record has been written, but before the modified buffer blocks are written to disk.
ARIES**
Data Structures
-
-
There are special redo-only log records generated during transaction rollback, called compensation log records (CLRs) in ARIES.
Recovery Algorithm
The analysis pass determines which transactions to undo, which pages were dirty at the time of the crash.
Redo pass starts from a certain position, and performs a redo, repeating history, to return the database to the state it was in before the crash
-
Other Features
Nested top actions
ARIES allows the logging of operations that should not
be undone even if a transaction gets rolled back
Recovery independence
Some pages can be retrieved regardless of others, so that they can be used even while other pages are being retrieved.
Savepoints
Transactions can record savepoints, and can be rolled back partially, up to a savepoint.
-
Recovery optimizations
Redo can be postponed on a page being fetched from disk, and performed when the page is fetched.
-
Remote Backup Systems
Needs high availability
We can achieve it by doing transaction processing at one site, called the primary site, and having a remote backup site where all data from the primary site is replicated (secondary site).
-
Recovery Algorithm
Transaction Rollback
each update action performed by the transaction or on behalf of the transaction is recorded in the log.
-
Storage
-
Data Access
Blocks
are the units of data transfer to and from disk, and may contain several data items.
Ways to call blocks
Physical blocks, blocks residing on the disk
Buffer blocks, blocks residing temporarily in main memory
disk buffer, area of memory where blocks reside temporarily
-