Database Reference
In-Depth Information
Site A
Site B
T1
T3
T2
T1
T1
T2
T3
Coordinator Site
Figure 18-21
Example of a false cycle.
and, at the same time, the coordinator has picked T3 as the victim to be aborted.
Then both T2 and T3 will be rolled back, although it is enough that T2 alone is
aborted.
Also, sometimes false cycles may be sensed and deadlock resolution may be
started unnecessarily. For example, refer to Figure 18-21 illustrating a false cycle in
the global wait-for graph. False cycles indicate phantom deadlocks.
Let us say that T3 releases the resource it is holding in site A. A message
to “delete” arrow from T1 to T3 is sent to the coordinator. At the same time,
assume that T3 requests for a resource held by T2 at site B. This results in an
“insert” arrow from T3 to T2 message to be sent to the coordinator. If the “delete”
message arrives at the coordinator site a little later than the arrival of the “insert”
message, a false cycle is recognized, causing unnecessary initiation of deadlock
resolution.
Distributed Scheme As the name of this scheme implies, no global wait-for graph
exists at a designated central site. Every site maintains its own wait-for graph. The
collection of all the wait-for graphs at the various sites forms the total graph for the
distributed database system. If at any time a deadlock is encountered, it is expected
that it will show up in at least one of the several wait-for graphs. This is the under-
lying principle of the distributed scheme.
A wait-for graph under this scheme differs from that under a centralized scheme
in one component. A wait-for graph under the distributed scheme contains one
extra transaction TO representing transactions that hold resources in other sites.
For example, an arrow T1
TO exists in a graph if T1 is waiting for a resource held
in another site by any transaction. Similarly, the arrow TO
Æ
T1 represents that any
transaction at another site is waiting for a resource in the current site held by T1.
Figure 18-22 represents the wait-for graphs at sites A and B when you add trans-
action TO to the wait-for graphs shown in Figure 18-19.
If a local wait-for graphs records a cycle not involving the TO transaction, then
you know it represents a deadlock condition. However, what does a cycle with TO
transaction as part of it represent? It only implies the possibility of a deadlock, not
Æ
Search WWH ::




Custom Search