Voting protocol in distributed system

  • View

  • Download

Embed Size (px)


  • 1. Voting Protocol In Distributed system By: Vasundhara Ghose B.Tech (CSE) 1

2. 2Topic covered : 3. 3Problem of service-denial Non-blocking protocols cant tolerate Multiplesite failures Communication failures Network partitioning failures 4. 4 SETOF RULES FOR FAILURE RECOVERY IN D.S. Assignment of no. of votes of Each replica If(majority of votes collected) { Replica is accessed by process } More fault tolerant than a commit protocol 5. 5 6. 6Proposed by Gifford.System model of S.V.P. : Replica of files lies on different sites. Sites wants to access file(LOCK EXISTS}Site has to unlock it 7. 7 Lockgenerating rules(while assessing afile): One writer and No readers Multiple readers and no writers Each site has lock manager. Lock manger >> LOCK related operations Version number for every file 8. 8Version number stores In Stable storage After every successful updatingUpdates its Version number 9. 9Assignment of votes to each replica Votes are collected by requesting process 10. 10 When process ofsite i requests for read/write Step 1: LOCK_REQUEST Step 2: Vote_REQUEST(WHEN lock is granted) Step 3: reception of VOTE REQUEST at site j If(lock request granted){ return( VN , NO. of votes assigned to replica ); } to site i 11. 11Site iOkay let me decide on basis of rule of algorithm Weather I have quorum or not ?? 12. 12If(Request is for Read) Vr=Vk P=sets of sites which have repliedVk= No of votes assigns/given by site k If(Vr>= r ){ Successful in obtaining read quorum } 13. 13If(Request is for WRITE) VW=Vk P=sets of sites which have repliedVk= No of votes assigns/given by site k Qcan be defined as M=max{VNj : jP} Q={jP : VNj=M} IfVW>= W )({ Successful in obtaining WRITE quorum(w) } 14. 14 If( Sites request is unsuccessful){ RELEASE_LOCK to all sites and its lock manger } If( sites request gets Quorum){ if(Weather it is latest copy or not) yes-> next step No> obtain current copy } 15. 15 If( request was for read) If( Reqest for write){ { Read the latest current copy available locally } Update localcopy Update Version number Send all updates and version number to all sites Q } 16. 16 RELEASE_LOCKREQUEST to all managerand all sites in P After receiving > updating in local copy by sites Releasing of locks (after receiving RELEASE_LOCK) 17. 17V= total no. of votes assigned to allthe replica R= read quorum ; w=write quorum r+w>v w > v/2 18. 18 Noneof old copies are updated. W = sum of subsets of replica R intersection w != null W value should high and high for disallowing simultaneous updating 19. 19Case 1:r=1 and w=5 Case 2: r=w=3 Case 3: site 3 is more reliable1Votes=1 75 msecs24 Votes=1 750 msecs3Votes=1 100 msecsVotes=2 750 msecs 20. 20So this type of voting scheme is known as static voting scheme, because voting assign policy does not bother with state of system.. 21. 21Case 4: Site 3 fails /unreachable,simultanously with any site unavailable 1Votes=1 75 msecs24 Votes=1 750 msecs3Votes=2 100 msecsVotes=1 750 msecs 22. 22>> Dynamic voting protocol DVP 23. 23Majority based approach Adaptive set of sites To allow access to data for updating when state of system change.Dynamic vote re-assignment The number of votes changes assigned to sites To allow access to data for updating when state of system change 24. 24 Dynamic voting protocol ensuresmore availabilitythan static voting protocol. Static voting protocol is non-adaptive in nature, that's why its hard to survive for that. Selection time dependent on system characterstics in dynamic voting protocol. 25. 25