Centralized deadlock detection technique / How to handle deadlock detection in distributed database? / False cycle in distributed database deadlock detection / What is false cycle?
Centralized deadlock detection approach
This is the technique used in distributed database system to handle deadlock detection. According to this approach, the system maintains one Global wait-for graph in a single chosen site, which is named as deadlock-detection coordinator. The Global wait-for graph is updated during the following conditions;
- Whenever a new edge is inserted or removed in the local wait-for graphs of any sites.
- Periodically
- Whenever the coordinator invokes the detection algorithm.
How does it work?
When
the deadlock-detection coordinator starts the deadlock-detection algorithm, it
searches for cycles. If the coordinator finds a cycle, then the following will
happen;
- The coordinator selects a victim transaction that need to be rolled back.
- The coordinator informs about the victim transaction to all the sites in the distributed database.
- The sites rollback the transaction.
This
approach (centralized detection approach) may lead to unnecessary rollbacks due to one of the following; (the
main cause is the communication delay.)
1.
False cycles -
2. Individual transaction
rollback during a deadlock and a victim is chosen – for example; let us assume
that a deadlock occurred in a distributed database. Then the coordinator
chooses one victim transaction and informs the sites about the victim to
rollback. At the same time, because of some other reasons, a transaction Ti
rollback itself. Now the whole system performed unnecessary rollbacks.
*************
Go to Deadlock handling in Distributed Database home