Presentation is loading. Please wait.

Presentation is loading. Please wait.

A Fault-Tolerant h-out of-k Mutual Exclusion Algorithm Using Cohorts Coteries for Distributed Systems Presented by Jehn-Ruey Jiang National Central University.

Similar presentations


Presentation on theme: "A Fault-Tolerant h-out of-k Mutual Exclusion Algorithm Using Cohorts Coteries for Distributed Systems Presented by Jehn-Ruey Jiang National Central University."— Presentation transcript:

1 A Fault-Tolerant h-out of-k Mutual Exclusion Algorithm Using Cohorts Coteries for Distributed Systems Presented by Jehn-Ruey Jiang National Central University Taiwan, R. O. C.

2 Distributed Systems  A distributed system consists of interconnected, autonomous nodes which communicate with each other by passing messages. Interconnected Network

3 Mutual Exclusion  A node in the system may need to enter the critical section (CS) occasionally to access a shared resource, such as a shared file or a shared table, etc.  How to control the nodes so that the shared resource is accessed by at most one node at a time is called the mutual exclusion problem.

4 Mutual Exclusion Example in CS

5 Mutual Exclusion Example in CS

6 k-Mutual Exclusion  If there are k, k  1, identical copies of shared resources, such as a k-user software license, then there can be at most k nodes accessing the resources at a time.  This raises the k-mutual exclusion problem.

7 k-Mutual Exclusion Example in CS k=2

8 k-Mutual Exclusion Example in CS k=2

9 h-out of k-mutual exclusion  On some occasions, a node may require to access h (1  h  k) copies out of the k shared resources at a time; for example, a node may need h disks from a pool of k disks to proceed.  How to control the nodes to acquire the desired number of resources with the total number of resources accessed concurrently not exceeding k is called the h-out of-k mutual exclusion problem or the h-out of-k resource allocation problem.

10 h-out of-k Mutual Exclusion Example in CS (h=2) in CS (h=1) k=3

11 h-out of-k Mutual Exclusion Example in CS (h=1) k=3

12 Related Work  Raynal (1991): uses request broadcast  Baldoni et al. (1998): uses k-arbiters  Manabe at al. (2004): uses (h, k)-arbiters  Jiang (2004): uses k-coteries

13 Jiang’s Algorithm  Among the four algorithms, only Jiang’s algorithm using k-coteries is fault-tolerant.  It can tolerate node and/or network link failures even when the failures lead to network partitioning.  It has lower message cost than others.

14 k-Coterie

15 Basic Idea of Jiang’s Alg.  A node should select h mutually disjoint sets and collect permissions from all the nodes of the h sets to enter CS for accessing h resources.  To render the algorithm fault-tolerant, a node is demanded to repeatedly reselect h mutually disjoint sets for gathering incremental permissions when a node fails to gather enough permissions to enter CS after a time-out period.

16 Drawbacks of Jiang’s Alg.  First, it does not specify explicitly how a node can efficiently select and reselect h mutually disjoint sets.  Second, when there is contention, a low-priority node always yields its gathered permissions to high-priority nodes, which causes higher message overhead and may prohibit nodes from entering CS concurrently.

17 Overview of the Proposed Alg.  Using a specific k-coterie  cohorts coterie  Having constant message cost in the best case  A candidate to achieve the highest availability among all the algorithms using k-coteries  Achieving k-concurrency by pre-release action and conditional inquiring

18 Cohorts Structure Coh(k, m)

19 Quorum under Coh(k, m)

20 Construction of Quorums under Coh(2, 4)  one primary cohort  with supporting cohorts at rear  E.G.: {5, 9, 10, 12} 11 12 8 4 14 10 7 6 5 32 1 9 12 11 12 8 4 14 10 7 6 5 32 1 9 12 11 12 8 4 14 10 7 6 5 32 1 9 12 There will be no disjoint quorum to be formed. and {1,2, 4, 8, 14}

21 Six Types of Messages  REQUEST  LOCKED  RELEASE  PRE-RELEASE  INQUIRE  RELINQUISH Comparison: Maekawa’s algorithm uses the following six messages: REQUEST LOCKED FAILED RELEASE INQUIRE RELINQUISH

22 Requesting h Resources  When a node u wants to enter CS to access h resources, u should invoke Get_Quorum(h, k, (C 1,...,C m )) and waits for it to return.  h, k: integers  (C 1,...,C m ): Cohorts Structure

23

24 Probe(C i, g)

25 Case 1 for Probe(C i, g) to return

26 Case 2 for Probe(C i, g) to return

27 Probe(C i, g) waits  It is noted that Probe(C i, g) will postpone the return if none of the three cases stands, which means no node in C i can reply to grant its permission immediately.

28 Case 3 for Probe(C i, g) to return

29 Pre-release

30 On Receiving REQUEST  On receiving a REQUEST from node u, a node v checks it is currently locked for another REQUEST. If not so, v marks itself locked, set u as the locker, records the number h of resources that u requests, and sends a LOCKED message to u.

31 Two Local Priority Queues  R-QUEUE: On receiving a REQUEST from node u, if v is locked for a REQUEST from another node w (w is the locker), the REQUEST from node u is inserted into R-QUEUE  P-QUEUE: On receiving a PRE-RELEASE message from node u, node v inserts the message into P-QUEUE.

32 Timestamp

33 Conflict Condition

34 On Receiving PRE-RELEASE  On receiving a PRE-RELEASE message from node u (u must be the locker), node v inserts the message into P-QUEUE.  It then marks itself unlocked if R-QUEUE is empty; otherwise, it removes from R- QUEUE the node w, sets w as locker, and sends w a LOCKED message, where w is the node at the front of R-QUEUE.

35 Conditional Inquiring  If conflict condition holds, node v then sends an INQUIRE message to node w.  It is not necessary to send the INQUIRY message if an INQUIRY has already sent to w and w has not yet sent RELINQUISH or RELEASE (we will explain the two messages later).

36 On receiving INQUIRE  When node w receives an INQUIRE message from node v, it replies a RELINQUISH message to cancel its lock if it is not in CS.  Otherwise, it replies a RELEASE message, but only after it exits CS. If an INQUIRE message has arrived after w has sent a RELEASE message, it is simply ignored.

37 On receiving RELINQUISH  On receiving a RELINQUISH message form w (w must be the locker), node v swaps w with u, sets u as the locker, and sends a LOCKED message to u, where u is the node at the front of R-QUEUE.

38 Effective Permission  Node u is said to have an effective permission of node v if u has received LOCKED from v and does not sent corresponding RELINQUISH or RELEASE to v.

39 Entering CS

40 Existing CS  After existing CS, node u should send RELEASE message to all the nodes to which u has sent REQUEST.

41 On receiving RELEASE  On receiving a RELEASE message from node u (u may or may not be the locker), node v removes u’s PRE-RELEASE message from P-QUEUE if u’s PRE-RELEASE message is in P-QUEUE.  Node v marks itself unlocked if R-QUEUE is empty; otherwise, it removes from R-QUEUE the REQUEST message of node w, sets w as locker, and sends w a LOCKED message, where w is the node whose REQUEST is at the front of R-QUEUE.

42 Analysis  Message Cost:  Best Case: 4c  h, where c is the cohort size, c > 2k  2  one REQUEST, LOCKED and RELEASE for each node in R and one PRERELEASE for the nodes in (C m  …  C m  h  1 )  R.  Worst Case: 7n, where n is the number of nodes  one REQUEST, INQUIRE, RELINQUISH, LOCKED, RELEASE, LOCKED for each nodes and one RELEASE for those not in R. (it occurs only when there are conflicting nodes.)

43 Comparison

44 Conclusion  The proposed algorithm becomes a k-mutual exclusion algorithm for k>h=1, and becomes a mutual exclusion algorithm for k=h=1.  It is resilient to node and/or link failures and has constant message cost in the best case.  It is a candidate to achieve the highest availability among all the algorithms using k-coteries since the cohorts coterie is ND.  It has the k-concurrency property, which guarantees that a low-priority node is not postponed by a high- priority node when there are not conflicting nodes.

45 Thanks!!

46 Dominated k-Coteries

47 Nondominated k-Coteries  Since an available quorum implies an available entry to CS, we should always concentrate on ND (nondominated) k-coteries that no other k- coterie can dominate.  The algorithm using ND k-coteries, for example the proposed algorithm, is a candidate to achieve the highest availability.


Download ppt "A Fault-Tolerant h-out of-k Mutual Exclusion Algorithm Using Cohorts Coteries for Distributed Systems Presented by Jehn-Ruey Jiang National Central University."

Similar presentations


Ads by Google