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

Voting protocol in distributed system

Embed Size (px)

Citation preview

Page 1: Voting protocol in distributed system

1

Voting ProtocolIn Distributed system

By: Vasundhara GhoseB.Tech (CSE)

Page 2: Voting protocol in distributed system

2

Topic covered : Need of voting protocol What is voting protocol? Types of voting protocol System model for static voting protocol Static voting protocol algorithm Vote assign ment policy Demo time Moving towards dynamic voting protocol conclusion

Page 3: Voting protocol in distributed system

3

Why we need Voting protocols? Problem of service-denialNon-blocking protocols can’t

tolerateMultiple site failuresCommunication failuresNetwork partitioning failures

Page 4: Voting protocol in distributed system

4

What is VOTING PROTOCOL? SET OF 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

Page 5: Voting protocol in distributed system

5

Types of Voting protocols:

Types of voting

protocol

Static protocol

Dynamic protocol

Page 6: Voting protocol in distributed system

6

What is static protocol?Proposed 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

Page 7: Voting protocol in distributed system

7

System model for S.V.P. (coun..) Lock generating rules(while

assessing a file):One writer and No readersMultiple readers and no writers

Each site has lock manager. Lock manger >> LOCK related

operations Version number for every file

Page 8: Voting protocol in distributed system

8System model for static voting protocol:

Version number stores In Stable storage

After every successful updating

Updates its Version number

Page 9: Voting protocol in distributed system

9

If read or WRITE quorum needed

Site must collects certain number of votes

permission granted ,IF U HAVE Required VOTES

Basic !dea of Static Voting protocol:Assignment of votes to each replica Votes are collected by requesting process

Page 10: Voting protocol in distributed system

10

Voting protocol algo: When process of site 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

Page 11: Voting protocol in distributed system

11

Voting protocol algo(cout..):

Weather I have

quorum or not ??

Site i

Okay let me decide on basis of rule of algorithm

Page 12: Voting protocol in distributed system

12

If(Request is for Read)Vr=ΣVk

P= sets of sites which have replied

Vk= No of votes assigns/given by site k

If (Vr>= r )

{

Successful in obtaining read quorum

}

Page 13: Voting protocol in distributed system

13

If(Request is for WRITE)VW=ΣVk

P= sets of sites which have replied

Vk= No of votes assigns/given by site k Q can be defined as

M=max{VNj : j€P}Q={j€P : VNj=M}

If (VW>= W )

{

Successful in obtaining WRITE quorum(w)

}

Page 14: Voting protocol in distributed system

14

If ( Site’s request is unsuccessful)

{ RELEASE_LOCK

to all sites and its lock manger

}

If ( site’s request gets Quorum)

{ if(Weather it is

latest copy or not)

yes-> next step

No> obtain current copy

}

Page 15: Voting protocol in distributed system

15

If ( request was for read)

{ Read the latest

current copy available locally

}

If ( Reqest for write)

{ Update local copy

Update Version number

Send all updates and version

number to all sites Q

}

Page 16: Voting protocol in distributed system

16

Last steps of SVP RELEASE_LOCK REQUEST to all manager

and all sites in PAfter receiving > updating in local copy by

sitesReleasing of locks (after receiving

RELEASE_LOCK)

Page 17: Voting protocol in distributed system

17

Vote assignment policy:

V= total no. of votes assigned to all the replica

R= read quorum ; w=write quorum

r + w > v w > v/2

Page 18: Voting protocol in distributed system

18

Condition to be satisfied by r and w:None of old copies are updated.W = sum of subsets of replicaR intersection w != nullW value should high and high for

disallowing simultaneous updating

Page 19: Voting protocol in distributed system

19

Demo time:

1

3

24

Votes=175 msecs

Votes=1750 msecs

Votes=2750 msecs

Votes=1100 msecs

Case 1: r=1 and w=5Case 2: r=w=3Case 3: site 3 is more reliable

Page 20: Voting protocol in distributed system

20

So this type of voting scheme is known as static voting scheme,

because voting assign policy does not bother with state of

system..

Page 21: Voting protocol in distributed system

21

Limitation of SVP:

1

3

24

Votes=175 msecs

Votes=1750 msecs

Votes=1750 msecs

Votes=2100 msecs

Case 4: Site 3 fails /unreachable,simultanously with any site unavailable

Page 22: Voting protocol in distributed system

22

We face:System failure /non-working state.

Solution >> Dynamic voting protocol

DVP solves problem by adapting nature

It adapt number of /set of sites that can form quorum

Prevention from communication failure

Page 23: Voting protocol in distributed system

23

Approaches of DVP• Adaptive set of

sites• To allow access to

data for updating when state of system change.

Majority based

approach

• The number of votes changes assigned to sites

• To allow access to data for updating when state of system change

Dynamic vote re-assignm

ent

Page 24: Voting protocol in distributed system

24

Conclusion:Dynamic voting protocol ensures

more availability than 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.

Page 25: Voting protocol in distributed system

25THANK

YOU Voti

ng p

roto

col