16.1 Failure Classification- Transaction failure (Logical error, System error)
- System crash
- Disk failure

16.1 Failure Classification

1. Types of Failures

Failures in a database system can occur due to various reasons. These include:

a. Transaction Failure

Occurs when a transaction cannot complete successfully. Two types of errors cause this:

  • Logical Error: Internal issues such as:
    • Bad input
    • Data not found
    • Overflow
    • Resource limit exceeded
  • System Error: The system enters an undesirable state (e.g., deadlock), causing the transaction to halt. However, the transaction can be re-executed later.

b. System Crash

  • Caused by hardware malfunctions, software bugs, or operating system failures.
  • Results in the loss of volatile storage (e.g., RAM) but assumes nonvolatile storage (e.g., hard disks) remains intact.
  • Based on the Fail-Stop Assumption: Systems halt when errors are detected, preventing further damage.

c. Disk Failure

  • Occurs when a disk block loses data due to:
    • Head crashes
    • Failures during data transfer
  • Recovery involves using:
    • Copies of data on other disks (e.g., RAID systems)
    • Archival backups (e.g., tapes, DVDs)

2. Recovery Actions

To ensure database consistency and atomicity after failures:

  1. During Normal Operation: Maintain enough information to recover from failures.
  2. After Failure: Use recovery algorithms to restore the database to a consistent state.