Solving Two Deadlock Cycles through Neighbor Replication on Grid Deadlock Detection Model

: A data grid is compose of hundreds of geographically distributed computers and storage resources usually locate under different places and enables users to share data and other resources. Problem statement: Data replication is one of the mechanisms in managing data grid architecture that receive particular attention since it can provide efficient access to data, fault tolerance, reduce access latency and also can enhance the performance of the system. However, during transaction deadlock may occur that can reduce the throughput by minimizing the available resources, so it becomes an important resource management problem in distributed systems. Approach: The Neighbor Replication on Grid Deadlock Detection (NRGDD) transaction model has been developed to handle two deadlock cycle problems on grid. By deploying this method, the transactions communicate with each other by passing the probe messages. The victim message has been used to detect the deadlock when the number of waiting resource by other transaction is highest and become as the cause of deadlock occurs. In addition, this transaction must be aborted to solve the problem. Results: NRGDD transaction model are able to detect and solve more than one cycle of deadlocks. Conclusion: NRGDD has resolve the deadlock problem by sending the minimum number of probes message to detect the deadlock and it can resolve the deadlock to ensure the transaction can be done smoothly.


INTRODUCTION
Data grid (Muruganantham et al., 2010) is the solutions that enable especially researcher to make their research on their specific fields. The researcher can know the latest issues that has been done by other researcher according to their fields of research such as method, technology, application and etc that has been used in enhancing the research fields. The concept of the computing grid arose from the need to share computing power, mostly for the jobs that use read only data sets as input (output from scientific experiments) (Noraziah et al., 2009;Radi et al., 2008). Consequently, the primary design of data management tools for grid computing was used to manage read-only data sets. A data grid is composed of hundreds of geographically distributed computers and storage resources usually located under different places and enables users to share data and other resources. The required for data grids because of the data is being produced at a tremendous rate and volume especially from scientific experiments in the fields of high-energy physics, molecular docking, computer micro-tomography and many others (Ahmad et al., 2010a;2010b). The grid computing requirements are more complex than distributed computing even though it is quite similar to normal distributed computing. Distributed computing refers to managing hundreds or thousands of computer systems that are individually more limited in their memory and processing power (Sashi and Thanamani, 2010). However, grid computing concentrates on the efficient use of a pool of heterogeneous systems with optimal workload management.
The major problem on grid environment is data management. In grid computing, there is no limitation on the number of users, departments or organizations. Besides that, the size of the data managed by data grids is continuously growing (Perez et al., 2010). In Data Grid, when a user requests a data, a large amount of bandwidth could be spent to send the data from the server to the client. Furthermore, the delay involved could be high (Bsoul et al., 2010). Data grid not only deals with efficient management but it is also deals with the placement and replication of large amounts of data.
Data replication (Sleit et al., 2007;Noraziah et al., 2007) is one of the technique or key components in data grid to increase availability and reliability of the data. Besides that, replication method can increase the system scalability, performance and fault tolerance (Fauzi et al., 2011;Mohammed, 2007). To speed up data access for data grid systems, data can be replicated in multiple locations, so that a user can access the data from nearby locations (Sashi and Thanamani, 2010). Furthermore, replication can reduce access latency; improve data locality, increase robustness, scalability and performance for distributed applications (Radi et al., 2008). Organizations need to provide current data to users who may be geographically remote and request distributed data around multiple sites in data grid (Ahmad et al., 2010a). A data grid is composed of hundreds of geographically distributed computers and storage resources usually located under different places and enables users to share data and other resources. Replication strategies determine when and where to create a replica, taking into account of the factors such as request number of the data, network conditions, storage availability of nodes, etc (Perez et al., 2010;Sun et al., 2009).
Read-One-Write-All (ROWA), Branch Replication Scheme (BRS), Hierarchical Replication Scheme (HRS) and Neighbor Replication on Grid (NRG) are the example of existing replication techniques. In ROWA technique (Noraziah et al., 2010) read operation has low communication cost. Meanwhile, this technique restricts the availability of write operations since they cannot be executed at the failure of any copy. In BRS technique (Perez et al., 2010), the clients that who request for the data file, the replicas are created as close as possible to them. The root replica grows toward the clients in a branching way, slip replicas into several sub replicas (Ahmad et al., 2010c;2010d). In this technique, the replica tree will be growing based on the client needs. In HRS technique, a hierarchical replication consists of a root database server and one or more database servers organized into a hierarchy topology (Perez et al., 2010). Using this technique, the data will be replicated or copy at all sites and has the highest storage of use. Neighbor Replication on Grid (NRG) considers only neighbors obtain a data copy where the neighbors are assigned with binary vote one and zero otherwise (Ahmad et al., 2010c;2010d). NRG requires significantly lower communication cost for an operation, while providing high system availability, due to the minimum number of quorum size required executing the transaction (Noraziah et al., 2009).
In replication, the concurrency control and deadlock (Senouci et al., 2007, Mohammed, 2007 handling is the most important problem that must have manages when sharing any data in distributed systems. The lock mechanism is use when the transaction make request to get a data. If the data is available, the transaction that make a request will get a lock for that data, otherwise it will wait until the data is unlock or released then it can be acquired again. In this situation, a deadlock may occur in which every transaction involve in the deadlock are waiting to grant the data that has been lock by other transaction that make a circular wait until an action is taken to detect and resolve deadlock problems. Deadlock can reduce the throughput by minimizing the available resources, so it becomes an important resource management problem in distributed systems (Srinivasan and Rajaram, 2011). There are two major deficiencies in deadlock where any other process cannot grant all the resources that held by the deadlocked processes and the deadlock persistence time will added to the reaction time of each process involved in the deadlock.
In this study, without lost of generality the terms nodes is used to indicate as transaction for the explanation. The new model namely Neighbor Replication Grid Deadlock Detection (NRDGG) (Zin et al., 2011b) is proposed to detect and solve the deadlock. NRGDD model is formed by combining the Multi-Cycle Deadlock Detection and Recovery (MC2DR) algorithm (Razzaque et al., 2007) and Neighbor Replication on Grid (NRG) replication model (Noraziah et al., 2009). NRG has been proposed in our previous work. NRG able to maximize the write availability with low communication cost due to the minimum number of quorum size required. However, the study not discuss on how to resolve the deadlock detection. The purpose of this research is to show how the new algorithm can detect the existence of real deadlock and resolve it through the NRG replication model.

MATERIALS AND METHODS
Deadlock occurs when different set of transaction waiting for each other to obtain the same resource, thus the transaction become stuck. This part describes NRG Deadlock Detection (NRGDD) transaction model which involves T as a transaction, D is the union of all data object manages by all transaction T of NRG and x represents one data object (or data file) in D to be modified by an element of T α , T β , T γ , T δ and T θ. Consider λ = α, β, γ, δ, θ where it represent different group for the transaction T. Meanwhile, PM is a probe message. It contain a set of probe messages where PM = {InitID, VictimID, DepCnt, RouteString}. Table 1 shows the probe message details description. Contains the identity of initiator of the algorithm VictimID A node or transaction that detects the deadlock sends the victim message to the node or transaction that cause of deadlock occurs. This node will be victimized for deadlock resolution. DepCnt The number of successor represent as a node or transaction which is waiting for resource. RouteString The node or transaction IDs visited by another node's (transaction's) probe message in order. Each node or transaction has a probe message storage structure also known as ProbeS, at most one probe message will be store on ProbeS at particular time. The history of ProbeS is independent; when the deadlock has been detected the probe message is erased from ProbeS. Meanwhile, transaction T λx,PM that detects the deadlock send a victim message to the transaction found to be victimized for the deadlock resolution. Victim message will be used for deleting probes from respective storage entries.
NRGDD transaction model consider different set of transactions T α , T β , T γ , T δ and T θ . All elements T α , T β , T γ , T δ and T θ may request data object x simultaneously at any site of S(B) either at the same or different site. Each set of transactions communicate with each other by message passing. Each of them bring the elements of probe message or PM where PM = {InitID, VictimID, DepCnt, RouteString}. At most one probe message will be store in probe storage, ProbeS.
An illustration example: Let us illustrate the working of new algorithm for detecting deadlock, through an example.
Consider the situation shown in Fig. 1. A different set of transactions T α , T β , T γ , T δ and T θ request a lock from a set of sited where S(B x ) = {A,B,C,D,E}. Each site contain replicated of data x. If the transaction of T αx,PM get lock from site i Є S(B x ) and other transaction will get lock from other site j Є S(B x ) | j ≠ i.
Each sites i Є S(B x ) has its own Lock Manager (LM) that process a request for a lock from the transaction either the lock can be granted or not. The lock is granted immediately when it is free otherwise; the lock manager will send a reject message to the requesting transaction or node ID, then inserts it into the waiting list for the lock. Each node is uniquely identified by its {site id: process id} pair and for the simplicity of explanation a unique number has assigned using integer numbers (0, 1, 2, 3, ..., n) to all transaction or node. The transactions or nodes will create elements of probe message (InitID, VictimID, DepCnt and RouteString), Tλ = {T λx, PM | PM=InitID, VictimID, DepCnt, RouteString}.

Implementation:
In this phase, we present the implementation of the system. The purpose of this implementation is to illustrate that our system can detect and resolve deadlock problems. This phase will detect two existing cycle of deadlock, for the previous research one cycle of deadlock has been detected (Zin et al., 2011a). In implementation phase, based on the NRG model we use a cluster with nine replication servers that are logically connected to each other in the form of two-dimensional 3×3 grid structure. Data object e in this experiment represent the data object x in NRGDD Transaction Model. Data e in site E will be replicate to each site that adjacent with site E, which is site B, D, F and H. Without lost of generality, five different set of transaction T α , T β , T γ , T δ and T θ come to update data e at replica B, D, E, F and H in the absence of system failures shows in Fig. 2.
Without lost of generality assume that each transaction as a node that brings the probe message. Each node of transaction has its own node ID (0, 1, 2, 3, 4). Figure 3 shows that each transaction waiting for each other to obtain the lock. Node 0, T αe,PM(0,0,1,"0") has initiated the lock that waiting for another node, node 1. Node 1, T βe,PM(0,1,2,"01") is waiting for node 2 and 3, node 3,T γe,PM(0,1,2,"013") is waiting for node 2 and node 2,T δe,PM(0,1,2,"012") is waiting for node 4,T θe,PM(0,1,2,"0124") where it's waiting for node 1. In forwarding the probe message to other nodes, a node must check the emptiness of its ProbeS first. It will compare its own DepCnt value with probe's DepCnt value when its ProbeS is empty. If this node's DepCnt is higher, then probe's VictimID and DepCnt values are updated with this node's ID and DepCnt values respectively; otherwise the values are kept intact. Before forwarding the probe message to all successors (the node that it's waiting) of this node, probe's RouteString field is updated by appending this node's ID at last of existing string (i.e., concatenate operation). One copy of updated probe message is saved in ProbeS of this node. For example, in Fig. 3 node 0 has initiated execution and send probe message (0,0,1,"0") to its successor node 1. As node 1's ProbeS is empty and DepCnt value is 2, it has updated the probe message, stored the modified probe (0,1,2,"01") in ProbeS and forwarded to its successors 2 and 3. Nodes 2, 3 and 4 have updated only the RouteS field of the probe message and forwarded to their successors.
Deadlock is detected when RouteString of node 4, T θe,PM(0,1,2,"0124") prefix with node 1, T βe,PM(0,1,2,"01") that start with "01". The probe message discards by the node that has detected a deadlock. Deadlock cycle can be detected at any node when the travelled path of probe message makes a dependency cycle.
Deadlock is resolved by aborting at least one node that involves in deadlock, hence other node can get the lock that has been released. In resolving this, the node with highest DepCnt value has selected as the victim and its will sends a victim message to all successors. If the detector node is not the initiator, it also sends the victim message to all simply blocked (node that is blocked but not a member of deadlock cycle) nodes. On receiving of this message, the victim node first send it to all of its successors or the resources that is waiting for and then releases all locks held by it and killed itself, other nodes delete deadlock detection message from their ProbeS memories.
Based on the Fig. 4 and Fig. 5, there are two cycles of deadlock that send probe message to node 1. However, only one cycle will be detected as deadlock cycle, if the probe message of deadlock cycle {1,2,4,1} is receive first then from the node 3 is discarded or vice versa. So, consider that Fig. 4 is the cycle of deadlock that must be solve when the cycle in Fig. 5 has been discarded. Node 1 has detected as a victim because it has the highest DepCnt value amongst the members in any of the cycles. And to resolve the deadlock detection, node 1 as a victim killed itself or aborts the lock and released it to another nodes. Node 1 is not the initiator, so it has also sent the victim message to simply blocked node 0. Nodes 4 stop further propagation of victim message.

RESULT AND DISCUSSION
In implementation, there are two cycles of deadlock has been detected. However, only one cycle will be solved and other cycle will discard. In the experiment will consider that cycle in Fig. 4 is first receiving probe message than Fig. 5. The Table 2 shows the result of the two cycle deadlock that has been detected.  In Table 2 present that Fig. 4 will be solve and Fig. 5 will be discarded. At t9 the replica B receives requested from replica H first after F requested for H then at t10 replica B receive request from H after D requested for H. When cycle of the deadlock has been detected, the resolve strategy will be applied. Table 3 shows the results to resolve the deadlock cycle. At t5, node 4 from replica H send probe message to B. Detect deadlock is detected when RouteString from T γe,PM(0, 1, 1, "0123") is prefix with T βe , PM (0, 1, 2, "01") , which is "01". Replica B receive victim message from replica H and it will propagate victim message to replica E and F and replica F will stop propagate the victim message to other replica. Then at time t11 the node 1, T βe,PM(0, 1, 2, "01") will be abort and killed. The lock at replica B will be released at t12. Other node of transactions can request a lock from replica B. Finally, the NRGDD can resolve deadlock cycle after the cycle of deadlock has detected.

CONCLUSION
Managing transaction in distributed databases is important in order to ensure the transaction can occur properly. The novel contribution of this study is a mechanism to handle two deadlock cycles problem by using Neighbor Replication on Grid Deadlock Detection (NRGDD) transaction model. Normally, the deadlock occurs when transaction in different set of transactions request the same resources that obtain by another transaction. NRGDD has resolve the deadlock problem by sending the minimum number of probes message to detect the deadlock and it can resolve the deadlock to ensure the transaction can be done smoothly.