International Journal of Digital Content Technology and its Applications Volume 4, Number 2, April 2010
P2P Replica-tree based Consistency Maintenance Strategy Ren Xun-Yi1, WANG Ru-chuan1, 2, Kong Qiang1 1. College of Computer Nanjing University of Posts and Telecommunications 2. State Key Laboratory for Novel Software Technology Nanjing University Nanjing, Jiangsu Province, China
[email protected] doi: 10.4156/jdcta.vol4.issue2.8
Abstract
replicas within the site and synchronized updated replicas among different sites. However, much attention has been paid to how at the same time to achieve synchrony and asynchrony, and a key structure of updating strategy is not received due emphasis. In reality process, the performance of updating strategy is subjected to the replica nodes relation including level and distance, which decide the overhead of updating message to achieve global consistency. In our preciously study [5], we have noticed this structure issue is a key factor and proposed one consistency maintenance model for data replicas in data grids. But it pay less attention for P2P communication time, in fact this point need to design and deeply discuss, so, in this paper, we conquer the shortcoming of preciously study to further reduce conflict numbers and response time.
Replica consistency maintenance plays a key role to improve the efficiency of replica management. This paper proposed one P2P Replica-tree based consistency maintenance strategy. In this strategy, social capacity is adopted for description of replica clustering coefficient, and one replica-tree is formed by dividing replica nodes into multi-levels. Especially peer-to-peer network with first-class replica nodes of different VOs is constructed to improve the communication performance. The experimental results show that the proposed strategy can reduce conflict numbers and response time compared with existing models.
Keywords Grid Computing; P2P; Data Replicas; Consistency Maintenance; Chord.
2. P2P Replica-tree based Consistency Maintenance Strategy
1. Introduction
Data grids aim at coordinately solving problems based on number of virtual organizations. Each Virtual Organization (VO) is regarded as one local environment comprised some nodes sharing data and resources according to special rules. Among different VOs, there is little communication. Therefore, within one VO, nodes often frequently request some replicas each other. By this we argue simultaneously strategy should be applied to internal of VO to reduce the conflict numbers, and Asynchronous update strategy used to improve data availability among different VOs. When the different nodes write the same replica in different nodes within one VO, replica conflict will be produced. In order to decrease the conflict and attain the replica consistency, the replica update message should quickly be sent and be received. In Data grids, replica nodes have played different roles in spreading message because of different communication capacity. In order to do all nodes best, we propose one measurement: Replica Clustering Coefficient (RCC) for represent the importance of replica nodes according
Replica consistency maintenance provides the function: when a replica changes, how to make all replicas and original data quickly agree in context. There are two major techniques used in replica consistency maintenance: pessimistic [1] and Optimistic [2]. The former apply simultaneously updating strategy, and the latter adopt asynchronous updating strategy. All two techniques have unique benefits and tradeoffs compared to each other. However, they need not be viewed as competing techniques. Using all the two techniques in a process continuum is better than using any one technique alone. In [3], Hu et al. presented a synchronous data consistency model which can make replicas consistency in the circumstances of network congestion or system failure. In [4], Belalem et al. absorbed the advantages of the two methods and introduced a hybrid model using pessimistic and optimistic methods, which can simultaneously updated
69
P2P Replica-tree based Consistency Maintenance Strategy Ren Xun-Yi, WANG Ru-chuan, Kong Qiang
to complex network, based on which, the replica nodes are classified different levels and form one update tree. In different VOs, because of the little communication among them, we should keep the replica availability of the same file; on the other hand, we also should efficiently achieve the consistency among different VOs because file replicas are multiple copies of a file which are spread across the different VOs. To access file, optimization algorithm must resolve a Logical File Name (LFN) replica to Physical File Name (PFN). If the same file has conflicted replicas in different VOs during a long time, the replica optimization algorithm will produce many mapping error and it will take a long time to execute withdraw operation. Our idea is to build one P2P network with first-level nodes to reduce the error as far as possible. P2P Replica-tree based consistency maintenance strategy include two necessary schemes: building replica-tree in all VOs and building peer-to-peer network with first-class replica nodes, as Figure 1.
R1 R2
VO1
Ri
VO2 VOi
represent the possibility of that the friend of replica node still own replicas. Definition 1 (Replica Clustering Coefficient). There h are N i number of nodes whose distance from node i is less than h hops, and the number of nodes keeping h(r ) replicas is Ni then the replica clustering coefficient of node i is given as follows:
Cih Nih ( r ) / Nih
Obviously 0 Ci 1 , Replica Clustering Coefficient shows the cluster property. For a node, if its RCC is lager, it has more friends around. Therefore the RCC can be used to measure the propagating capacity of replica updating. By these nodes with lager RCC, we can quickly notify the other "friends", and update all replicas simultaneously. According to RCC, we classify replicas into multiple levels, and first-level node is the most important and can be defined as follows. Definition 2 (First-level Node). The First-level Node has the largest RCC of all nodes keeping replicas which distance is less h jumps from the node i , that is to say the RCC of the first-level nodes are satisfied with the following formula: h
Building peer-to-peer network Building replica-tree
C hj max Cih i 1,2...n st. dis(i, j ) h
Figure 1. Consistency Maintenance Strategy Because one new replica node is generated by copying data from other replica nodes or original node, the replica nodes are all interconnected in on VOs. Among one VOi, the represented node Ri is selected with maximize RCC. All Ri are connected to constitute a P2P network.
(3)
Definition 2 tells us first-level replica nodes have the most around replicas, and it is the core node. According to RCC, we can define second-level replica nodes and multi-level replica nodes. Definition 3 (The K-level replica nodes) When K> = 2, the RCC of K-level replica nodes are smaller than the RCC of K-1level replica nodes. Definition 4 (Replica-Tree). All level replica nodes have priority to connect with the highest-level replica node, and discard connecting with previous low-level replica nodes, by this means the optimization tree is Replica-Tree. Definition 4 is to use the "priority connecting mechanism" which is also called as ―Matthew Effect‖ in sociology. Here we adopt it to improve the efficiency of the replica consistency management. By definition 4, corresponding replica tree to Fig.1 is shown in Fig. 3. In this way, the internal updating process of each VO in the essence is to order replica tree.
3. Building replica-tree in all Vos Clustering feature can be measured by clustering coefficient Ci . Assuming that a network node i has ki neighbors, the maximum number of edges among nodes is ki (ki 1) / 2 . If actual number of edge is Ei , the clustering coefficient is :
Ci 2Ei / (ki (ki 1))
(2)
(1)
The above formula means the probability of two friends of one node is still "friends". If Ci of one node is greater, the node have more friends and these friends are closely put together. Based on the clustering coefficient, we define replica clustering coefficient to
70
International Journal of Digital Content Technology and its Applications Volume 4, Number 2, April 2010
update report update initiated by first-level node
Rn
VOn
Ri
update initiated by other-level nodes
A
R1 VO1
C
D
E
P2P network R3 R2 VO2
VO3
Figure 3. Replica Consistency Maintaining Model based on P2P
F I
B K
G
In order to efficiently spread the update message over all VOs, we adopted a chord to provide excellent lookup performance and little maintenance consistency cost. The core of chord is using consistent hashing [6] to efficiently map keys to nodes. Consistent hashing has several good properties, for example, it balances load, and when a node joins or leave, only an O (1/N) fraction of the keys are moved to a different location. Moreover, in chord node network, improvement of the scalability of consistent hashing may avoid the requirement that every node know about every other node. Each node maintains information only about O (logN) other nodes and a lookup requires O (logN) messages. Especially, the consistency maintenance of routing information, when a node joins or leaves the network, only requires O (log2N) messages. The chord provides consistency maintenance idea for our model. The different point is the object of maintenance is change: in chord it is routing information, whereas in our model, it is replica. So, we improve the chord and R-chord as follows. In R-chord, consistent hashing assigns each node and replica keys an m–bit identifier using a SHA [6]. A node’s identifier is chosen by hashing the node’s IP address, and a replica key identifier is produced by hashing the replica key. Replica key is hashing value which includes the replica metadata such as replica name, replica size and replica creation time, namely: replica _ key hash(replica _ metadata) (4) Each replica_key is stored in its successor node whose identify is equal to or larger than replica_key: (5) node _ key successor (replica _ key) All identifier consist a circle such as Figure 4.
H
Figure 2. Replica Tree In Figure 2, node F is third-level replica node, but according to the principle of priority connecting mechanism, it abandons the connection edge with node E, and directly connects with A. Similarly node B and node I directly connect with A. In fact, node I is fourthlevel replica node, but it can directly connects with the first-level replica node A, therefore, replica-tree can always guarantee that a replica node connect with the highest-level as the maximum as possible. In this way, update message will transfer along the fastest direction. For example, replica in H node is updated, H will send updated message uploaded to the E, and E pass message to A. but node A immediately send update message to five nodes (B,C,D,F,I), and other send message to three nodes. Therefore, our strategy can as far as possible enhance the internal replica consistency management efficiency in the local VO.
4. Building peer-to-peer network with firstclass replica nodes Replica Consistency Maintaining Model based on P2P is composed of many Ri in different VOs, each Ri sent updated message to other Ri as Figure 3. When one replica node-H changes its replica, firstly it sends the update message to the first-level replica node -A in local VO and parallel operation are execute as follows: (1) First-level replica node notify its second-level replica nodes and second-level replica nodes notify its third-level replicas nodes, and so on, until all level replica nodes receive the notify. (2) Firstlevel replica node-A informs other Ri in other VOs, each Ri is responsible for internal replica updating.
71
P2P Replica-tree based Consistency Maintenance Strategy Ren Xun-Yi, WANG Ru-chuan, Kong Qiang
Replica _key=OGSA
IP=202.119.230.8
The performance of consistency maintenance methods can be measured by the conflict numbers and response time. We use Optorsim to simulate a data grid with mixed structure. Compared with optimistic, pessimistic, Hybrid model proposed in [4] and our preciously model-RCRMT [5], the results are shown as Figure 5 and Figure 6. Figure 5 is the conflict numbers over time; and Figurer 6 is the response time by the site numbers.
N0
N41
N3 K35
N8 N36
K6
K9 N12
Replica_key=Grid middleware N26
N20 Replica _key=WRSF
numbers of conflict
N32
Figure 4. An identifier circle consisting of the many nodes
30
pessimistic
20
Hyperbird
10
RCMRT
0
our
5
In this example, N36 is hashing the node’s IP
8
11
13
15
18
21
24
27
30
33
35
38
41
strategy
unit time(1 unit=1000s)
address 202.119.230.8. Key 6 is hashing the Replica_key OGSA and located at node8, and key 9 hashing the Replica_key WRSF at node8 and key 35 hashing Grid Middleware at node36. As long as replica key location is known, the associate replica file is easily to be retrieved by replica metadata. For a given identifier lookup can be passed around the circle via successor pointers until they first encounter a node that succeeds the identifier that is the node the query maps to. To accelerate this process, similar to chord, in RChord each node maintains a routing table with (at most) m entries called the finger table [6]. Different from the chord is that in R-Chord, we employ Bchord [7] to spread update message in double directions. The figure item is as follows: for given node with number n, (iif i is a prime, the ith item equal to n.figure[i]=n-2 1)/2 i/2 , else n.figure[i]=n-2 . The new figure table is as Table 1. Table 1. Router table Replica_Key n.Figure[i]=n-2(i-1)/ 2 n.B-figure[i]= n-2i/2 Successor predecessor
optimistic
40
Figure 5. Conflicts by time response time(s)
ROWA
60
Quorum
40
Hyperbird RCMRT
20
our streastry
0 13
19
34
46
58
72
81
92
numbers of sites
Figure 6. Response time by numbers of sites It can be seen from Figure 5, the conflict numbers using optimistic method is most than other methods, the main reason is optimistic approach emphasis on data availability, and measures are taken to maintain consistency only if discovering the conflict. Hybrid method is a comprehensive optimistic and pessimistic, so its conflict numbers is less than pessimistic methods’. Obviously, conflict numbers of our proposed new strategy is less than pessimistic method and RCMRT because we have adopted first-level replica node and replica tree and P2P network to efficiently achieve consistency maintenance. From Figure 6 can be seen in different ways, ROWA (Read One Write All) [8] have the most time-consuming, because it has the worst availability, Quroum [9] has the moderate time-consuming, and Hybrid has less time-consuming because the latter two methods also take into account the availability. Obviously, our proposed new strategy has the least time-consuming than RCMRT and other methods. The main reason is we apply globe P2P model, compared with our preciously work with SemiP2P model, we save much time in communication message deliver process.
Node_key Successor(Replica_Key) Predecessor(Replica_Key) Successor(n) Predecessor(n)
According to the Table 1, the replicas update procedure as follows: when received notification of update message, the figure table is looked up until the node that contains the replica is found. The lookup begin from the final node which figure table is needed update, namely the nodekey=successor [(nodekey+2n2i-1) mod 2n], then check the nodekey’s Predecessor (n); Loop this procedure until all replica become consistency.
5. Experimental Results and Analysis
72
International Journal of Digital Content Technology and its Applications Volume 4, Number 2, April 2010
6. Conclusions This paper proposed one efficient consistency maintenance strategy which comprises two schemes: building replica-tree in all VOs and Building peer-topeer network with first-class replica nodes VOs. We introduce the replica tree and deeply discuss replica consistency maintaining model based on P2P and conquer the shortcoming of preciously study to further reduce conflict numbers and response time. Experimental results showed that the model itself can effectively reduce the conflict numbers and speed up response time.
7. References [1] Saito Y, Shapiro M, Optimistic replication. ACM Computing Survey, Vol. 37, No. 1, 2005, pp. 42-81. [2] Saito Y, Levy H, Optimistic replication for internet data services. In Proc. of the 14th Int. Conf. on Distributed Computing, London: Springer-Verlag, October, 2000, pp. 297-314. [3] J. Hu, Xiao N, Zhao Y, et al., An Asynchronous Replica Consistency Model in Data Grid. Parallel and distributed processing and applications (ISPA 2005 Workshops). Nanjing: Springer-Verlag, November, 2005, pp. 475-484. [4] Belalem G, Slimani Y. A hybrid approach to replica management in data grids. International Journal of Web and Grid Services, Vol. 3, No.1, 2007, pp. 2-18. [5] REN Xun-yi, WANG Ru-chuan, KONG Qiang, Efficient Model for Replica Consistency Maintenance in Data Grids, 2009 International Symposium on Computer Science and its Applications,2009,pp. 159-162. [6] Stoica I, Morris R, Karger D, et al., Chord: a scalable peer-to-peer lookup service for internet applications[C]∥ ACM SIGCOMM 2001. San Diego, CA, USA: ACM, 2001,pp. 149-160. [7] Zheng Yan, Chen Hong-wei, Wang Ru-chuan, et al., Novel distributed Hash table——BChord. Journal on Communications, Vol. 29, No. 2, 2008, pp. 22-27. [8] Amir Y. Wool A, Optimal availability quorum systems: Theory and practice. Information Processing Letters, Vol.65, No.5, 1998, pp. 223–22. [9] Goel S, Sharda H , Taniar D, Replica synchronization in grid databases. International Journal of Web and Grid Services, Vol. 1, No. 1, 2005,pp. 87–112. The subject is sponsored by the National Natural Science Foundation of P. R. China (No. 60573141 & 60773041), National 863 High Technology Research Program of P. R. China ( No. 2006AA01Z201, 2006AA01Z439, 2007AA01Z404, 2007AA01Z478), The Talent Project of Nanjing University of Posts and Telecommunications(NY208006)
73