Information Technology Reference
In-Depth Information
4.1
Transaction Aborts, Process Failures, and System
Crashes
During transaction processing, a transaction can abort for one of the following
reasons:
1. The application process itself requests the abort and rollback of the transaction
by the SQL statement rollback .
2. The database management system aborts the transaction because of a deadlock
or because the application process seems to have failed or the connection to it is
cut off.
3. A process failure of the server-process thread that executes the database actions
of the transaction.
4. A system crash of the database system due to a failure in the hardware or power
supply or due to a software fault in the database management system or operating
system.
5. The system is shut down by the database system administrator.
In case (1) the actions needed in aborting and rolling back the transaction are
included in the execution of the rollback statement in the server-process thread
that services the application process. In case (2) the backward-rolling phase of the
transaction is performed on behalf of the transaction by the process-monitor process
or by a new server-process thread allocated for the purpose. In case (3) the rollback
is also performed by the process-monitor process or by a new server-process thread,
but before that can happen, the possibly corrupted pages (if any) held write-latched
by the failed process thread at the time of the failure must first be restored to an
action-consistent state. This is done by fetching the disk versions of the pages and
applying the log records to redo the missing updates on the pages.
In cases (4) and (5), all processes in the system fail, and the contents of
main-memory disappear, so that all main memory structures needed for database
management are lost; when the system is started up, restart recovery is performed
so as to restore the state of the database that existed at the time of the crash or
shutdown and to abort and roll back all forward-rolling transactions and to complete
the rollback of all backward-rolling transactions. The restoring of the database state
includes fetching from the disk all pages that resided as modified in the buffer at
the time of the crash or shutdown and applying the log records to redo the missing
updates. In case (5) there probably are no transactions active, so that no transaction
rollbacks are needed.
In all the cases, transaction rollback can be performed by means of the log and
the active-transaction table, whose contents survive in cases (1), (2), and (3) and are
reconstructed from a logged snapshot and transaction-control log records in cases
(4) and (5). The restoration of the database state in cases (3), (4), and (5) uses disk
versions of modified pages, log records survived on disk, and a logged snapshot of
the modified-page table (whose contents are also reconstructed, using log records
for update actions).
Search WWH ::




Custom Search