download

Matakuliah
Tahun
Versi
: M0184 / Pengolahan Data Distribusi
: 2005
:
Session - 18
RECOVERY CONTROL - 2
OBJECTIVE
• Local recovery protocol
• Distributed Recovery Protocol
• Recovery in Multidatabase
Local Recovery Protocol
• In a DDBMS, we have to consider both
global and local atomicity and durability of
transaction.
• Four principal algorithms :
1. Undo/Redo
2. Undo/no-redo
3. No-undo/redo
4. No-und/no-redo
UNDO / REDO
• The most complex algorithm, since they
involve both undoing and redoing
transaction following failure
• This approach has advantage of allowing
the buffer manager to decide when to flush
the buffers, hence reducing I/O overhead
• A variation on undo/redo is for the
recovery manager to keep an active-list,
an abort-list and a commit-list
UNDO/NO-REDO
• DB buffers are flushed at commit, so there
will be never be any need to redo
transaction on restart and hence there is
no need to store after images on the log.
• Recovery manager only concern with
transaction active at the time of failure
which will have to be undone
NO-UNDO/REDO
• The recovery manager does not write
uncommitted transaction to the stable DB.
• The buffer manager id forced to retain the
records in main memory in the DB buffers
until commit and this is known as pinning
the buffer.
• Alternatively, update can be written to the
log instead of the DB buffers or shadowing
can be used
NO-UNDO/NO-REDO
• In order to avoid having to undo
transaction, recovery manager has to
ensure that no updates of transactions are
written to the stable DB prior to commit
• To avoid having to redo transaction,
recovery manager requires that all
updates are written to the stable DB prior
to commit
• This can be resolved by writing to the
stable DB in a single atomic action at
commit
Distributed Recovery Protocol
• An important aim of recovery techniques
for DDBMS is that the failure of one site
should not affect processing at another
site
• Two common commit protocols :
1. Two-phase commit (2PC)
2. Three-phase commit (3PC)
TWO-PHASE COMMIT (2PC)
• 2PC operates in two phase : voting phase and
decision phase
• All participant are asked by the coordinator
whether or not they are prepared to commit the
transaction.
• If one participant votes to abort, then the
coordinator instructs all participant to abort the
transaction
• If all vote to commit, the all participant are told to
commit the transaction
THREE-PHASE COMMIT (3PC)
• The basic idea is to remove the
uncertainty period for participant who have
voted “commit” and are waiting for the
“global abort” or “global commit” from the
coordinator.
• The third phase called pre-commit
Recovery in Multidatabase
• The global transaction must have
information about local transaction in order
to produce globally serializable schedules.
• The problem for multidatabase is almost
equivalent to fully partitioned networks in
which each site runs in an independent
partition.