Flashcards
reliability and recovery
Cards in this deck (34)
- 1What is purpose of reliability and recovery?how to maintain atomicity and durability properties of
transactions. - 2What are 4 diff types of failures?transaction failures (aborts)-due to an error in the
transaction as well as the detection of a present or potential deadlock.
site (system) failures:
hardware or to a software failure, such as failure of
processor, main memory, power supply,
main memory contents are lost, but secondary storage contents are safe.. Total failure refers to
the simultaneous failure of all sites in the distributed system; partial failure indicates the failure of only
some sites while the others remain operational.
, media (disk) failures :
failures of secondary storage devices such that the stored data is lost. Such
failures may be due to operating system errors, as well as to hardware faults such as head crashes or
controller failures.
Communication line
failures: - unique to the distributed case,
,Lost or undeliverable messages are typically the consequence of communication line failures or
(destination) site failures. Can lead to network partitioning. (partitions which cannot access each other) - 3how to handle Different types of failures?Transaction F -abort the transaction, thus resetting the
database to its state prior to the start of this transaction
System (site) failures- ?? - 4What is network partitioning in relation to failures in DDBS?. If a communication line fails, in addition to losing the message(s) in transit, it
may also divide the network into two or more disjoint groups. This is called network partitioning. If the
network is partitioned, the sites in each partition may continue to operate. In this case, executing
transactions that access data stored in multiple partitions becomes a major issue. - 5Whats local recovery management all about?Its about LRM managing recovery functions at each site to maintain atomicity and durability of local transactions
- 6What commands are issued to LRM?commands that are passed to the LRM, which are begin transaction,
read, write, commit, and abort - 7what are 2 types of storageS?Volatile (main memory RAM) and stable
storage (implemented combination of hardware (non-volatile storage) and software (stable-write, stable-read,
clean-up) components) - 8What is a stable database and how is its data managed?- database that is kept on stable storage the stable database
- unit of storage = page
- database buffer manager keeps some of the
recently accessed data in main memory buffers.
- buffer is divided into pages that are of the
same size as the stable database pages - 9Whats volatile database?. The part of the database that is in the database buffer is called
the volatile database. - 10How do recovery take place after a crash?Through the use of database logs which store : transaction identifier, type of operation (action), items accessed by the
transaction to perform the action, old value (state) of item (before image), new value (state) of item (after
image), and etc.
Durabilty states that during crash recovery all stransaction that had completed should be REDO. and those which werre partially completed should be UNDO. - 11What are UNDO and REDO operations?REDO'ing an action means performing it again.
The REDO operation uses the log information and
performs the action that might have been done before, or not done due to failures. The REDO operation
generates the new image
UNDO'ing an action means to restore the object to its before image. The UNDO operation uses the log
information and restores the old value of the object - 12What and whhy is there a need for Write Ahead Log (WAL)?In an unfortunate case if System writes P in stable database, and then system failure occurs
before stable log is updated. We cannot recover from this failure because there is no log record to restore
the old value.
Therefore, the solution is that the stable log should be always updated prior to the updating of the stable
database, which is known as the Write-Ahead Log (WAL) protocol. - 13How many types of logs are there with respect to recovery?Undo portion of log and redo portion.
- 14Describe the WAL (write ahead log) protocol?. ŒBefore a stable database is updated, the undo portion of the log should be written to the stable
log
2. When a transaction commits, the redo portion of the log must be written to stable log prior to the
updating of the stable database. - 15Where is the log stored?Its stored in both stable storage as well as in main memory buffers.
It is written to stable storage either synchronously(whenever log is written) or asynchronously (when buffer is full or periodically) - 16What and why is checkpoint useful?To avoid searching all transaction logs by LRM, check point simplifies the task of determining actions of transactions that need to
be undone or redone when a failure occurs.
A checkpoint record contains a list of active transactions.
ŒWrite a begin_checkpoint record into the log
2. Collect the checkpoint dat into the stable storage
3. Write an end_checkpoint record into the log - 17Give example of Checkpoint?
- 18How do we deal with media failures?BY backing up database and log on tertiary storage such as magnetic tape or CD rom.
Also To deal with less catastrophic failures, having duplicate copies of
the database and log may be sufficient. - 19What is the concern related to archiving and how may it be dealt with?how the archive database is stored. If
we consider the large sizes of current databases, the overhead of writing the entire database to tertiary
storage is significant. Two methods that have been proposed for dealing with this are to perform the
archiving activity concurrent with normal processing and to archive the database incrementally as
changes occur so that each archive version contains only the changes that have occurred since the
previous archiving - 20Whats purpose of distributed reliability protocols?maintain the atomicity and durability of
distributed transactions that execute over a number of databases.
The protocols address the distributed
execution of the begin transaction, read, write, abort, commit, and recover commands. - 21What are the 3 components of distributed reliability protocols?Commmit protocol - determines how commit will be executed in a distributed transaction to enrure durability and atomicity.
Termination protocol - determines how remaining sites will deal when a failure occurs. preferred non blocking
Recovery protocol - deals with how particular site will deal with when a transaction faliur occurs. - preferred independent - 22What happens in 2PC?ensures the atomic commitment of
distributed transactions.
The coordinator aborts a transaction if and only if at least one participant votes to abort it.
2. The coordinator commits a transaction if and only if all of the participants vote to commit it. - 23What are types of 2PC structures?Centralized and Linear (Nested) 2PC and distributed 2PC?
- 24What happens in Centralized 2PC?
- 25Waht happens in linear /nested 2PC?
- 26What happens in distributed 2PC?The coordinator sends the prepare message to all participants. Each participant then sends its decision to
all the other participants (and
to the coordinator) by means of either a "vote-commit" or a "vote-abort" message. Each participant waits
for messages from all the other participants and makes its termination decision according to the global
commit rule. - 27How is failure of a site determined in termination protocol of 2PC?Termination protocols deal with the timeouts at the operational sites. There are different states in which
the coordinator can timeout: INITIAL, WAIT, COMMIT, and ABORT.
s. A
timeout occurs at a destination site when it cannot get an expected message from a source site within the
expected time period. In this section we consider that this is due to the failure of the source site. - 28Explain possible timeout situations in coordinattor and participant in 2PC.Coordinator:
Timeout in INITIAL state. This state is not important
2. Timeout in WAIT state. In the WAIT state, the coordinator is waiting for the local decisions of the
participants. The coordinator cannot unilaterally commit the transaction; however, it can
unilaterally decide to globally abort the transaction.
3. Timeout in ABORT or COMMIT states. In this case the coordinator is not certain that the commit or
abort procedures have been completed by the local recovery managers at all of the participant
sites. Thus the coordinator stay blocked and wait for the acknowledgement.
PARTICIPANT:
Timeout in the INITIAL state. In this state the participant is waiting for a "prepare" message. The
coordinator must have failed in INITIAL state. The participant can unilaterally abort the transaction
following a timeout.
2. Timeout in the READY state. In this state the participant has voted to commit the transaction but
does not know the global decision of the coordinator. In this case the participant will remain
blocked until it can learn from someone (either the coordinator or some other par - 29Explain recovery protocol for 2PC for both Coordinator and participantCoordinator:-
INITIAL state. This is before the coordinator has initiated the commit procedure.
Therefore, it will start the commit process upon recovery
WAIT state - restart commit process by sending prepare message again to all.
ABORT or COMMIT state - if all ack received = do nothing. if some remaining = stay blocked.
PARTICIPANT -
INITIAL state. The participant should abort the transaction unilaterally upon recovery
READY - treat this as timeout in READY state and invoke
the termination protocol (stays blocked).
ABORT or COMMIT state - represent the termination conditions.nothing needs to be done - 30Issues with 2PC ?1. it is not possible to design protocols that can
guarantee independent recovery while maintaining the atomicity of distributed transactions
2. 2PC are inherently blocking. Ready implies that
the participant waits for the coordinator. If coordinator fails, the site is blocked until recovery. Blocking
reduces availability of the entire distributed database system.
Independent recovery protocols exist only for single site failures; no
independent recovery protocol exists which is resilient to multiple-site failures. - 31Whats 3PC?2PC with additional state called precommit pre abort that is before abort and commit states.
- 32What are types of network partitions?. A
partitioning is called a simple partitioning if the network is divided into only two components (partitions);
otherwise (more than two partitions), it is called multiple partitioning. - 33What are 2 strategies employeed for network partiitoning ?s. We can either permit all the partitions to continue their normal operations and accept
the fact that database consistency may be compromised, which improves availability; or we guarantee
the consistency of the database by employing strategies that would allow one group to terminate while
the other is blocked. This decision problem is the premise of a classification of partition handling
strategies. We can classify the strategies as pessimistic that emphasises the consistency of database or
optimistic that emphasises the availability of
the database even if this would cause inconsistencies.
All the known termination protocols that deal with network partitioning in the case of non-replicated
databases are pessimistic. How to determine which gropu to terminate?
. We consider two approaches: centralized protocols which indicates
whichever partitions contains the central site should terminate the transaction; voting-based protocols,
which the idea of majority voting has been generalized to voting with quorums. - 34I dont understand first rule of voting mechanism to determine commiting or aborting in pessimistic approach of termination protocol for network partitioning
Information
- Description
- Distributed Database Flashcards on reliability and recovery, created by Varun m on 03/06/2017.
- Created by
- Varun m
- Views
- 1
- Rating