TCSS 558: APPLIED DISTRIBUTED COMPUTING, Lecture notes of Network Technologies and TCP/IP

I understand how to implement a static file membership. (static and dynamic list) tracking system when the servers are.

Typology: Lecture notes

2022/2023

Uploaded on 05/11/2023

lakshminath
lakshminath 🇺🇸

4

(2)

223 documents

1 / 32

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
TCSS 558: Applied Distributed Computing
[Winter 2021] School of Engineering and Technology,
UW-Tacoma
March 11, 2021
Slides by Wes J. Lloyd L18.1
Ch apter 6 Co ordination - IV
Wes J. Lloyd
School of Engi neering
& Techno logy (SET)
Un ivers ity of Washin gton - Tacoma
TCSS 558:
APPLIED DISTRIBUTED COMPUTING
Qu est ions fr om 3/ 9
As si gnm en t 2: Re pl ica te d Key Va lu e S to re
Revi ew : Act iv ity 4 Tota l Or de red M ul tic as ti ng
Ch apter 6 : Coo rd inati on
Chapt er 6.2: Vecto r C locks
Revi ew : Act iv ity 5 Ca usa li ty an d Vector C lo cks
Ch apter 6 : Coo rd inati on
Chapter 6.3 : Dis tributed Mu tual E xclus ion
Pr actic e Final Exa m Que st ions
March 11, 2021 TCSS558: Applied Distributed Computing [Winter 2021]
School of Engineering and Technology, University of Washington - Tacoma L18.2
OBJECTIVES 3/11
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20

Partial preview of the text

Download TCSS 558: APPLIED DISTRIBUTED COMPUTING and more Lecture notes Network Technologies and TCP/IP in PDF only on Docsity!

[Winter 2021] School of Engineering and Technology, UW-Tacoma

Chapter 6 – Coordination - IV

Wes J. Lloyd

School of Engineering

& Technology (SET)

University of Washington - Tacoma

TCSS 558: APPLIED DISTRIBUTED COMPUTING

 Questions from 3/

 Assignment 2: Replicated Key Value Store

 Review: Activity 4 – Total Ordered Multicasting

 Chapter 6: Coordination

 Chapter 6.2: Vector Clocks

 Review: Activity 5 – Causality and Vector Clocks

 Chapter 6: Coordination

 Chapter 6.3: Distributed Mutual Exclusion

 Practice Final Exam Questions

March 11, 2021 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18. OBJECTIVES – 3/

[Winter 2021] School of Engineering and Technology, UW-Tacoma  Daily Feedback Quiz in Canvas – Available After Each Class  Extra credit available for completing surveys ON TIME  Tuesday surveys: due by ~ Wed @ 10p  Thursday sur veys: due ~ Mon @ 10p March 11, 2021 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18. ONLINE DAILY FEEDBACK SURVEY March 11, 2021 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18.

[Winter 2021] School of Engineering and Technology, UW-Tacoma  Can we submit assignment-2 without implementing the docker? If yes, how many points does the team lose?  The docker files are scored as 5 points  However, if the docker files (runser ver.sh) is the only documentation that describes how to deploy your distributed key value store is missing, the p oint los s c ould b e muc h mor e!  Implementing docker involves updating the docker_ser ver and d o cker_client directories  do cker_ser ver should have a runserver.sh script that describes how to star t the ser ver and configure methods of membership tracking  runserver.sh script should have comments  Examples for star ting ser ver s with all available methods of membership tracking should be provided  Can comment out using “#” all but the active method  Container rebuilt w/ new runserver.sh to change method for testing March 11, 2021 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18. FEEDBACK - 2

 Questions from 3/

 Assignment 2: Replicated Key Value Store

 Review: Activity 4 – Total Ordered Multicasting

 Chapter 6: Coordination

 Chapter 6.2: Vector Clocks

 Review: Activity 5 – Causality and Vector Clocks

 Chapter 6: Coordination

 Chapter 6.3: Distributed Mutual Exclusion

 Practice Final Exam Questions

March 11, 2021 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18. OBJECTIVES – 3/

[Winter 2021] School of Engineering and Technology, UW-Tacoma  Include readme.txt or doc file with instructions in submission  Must document membership tracking method

please indicate which types to test << ID Description F Static file membership tracking – file is not reread FD Static file membership tracking DYNAMIC - file is periodically reread to refresh membership list T TCP membership tracking – servers are configured to refer to central membership ser ver U UDP membership tracking - automatically discovers nodes with no configuration March 11, 2021 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18. SHORT-HAND-CODES FOR MEMBERSHIP TRACKING APPROACHES  Due Saturday March 20th^ at 11:59am (revised)  Goal: Replicated Key Value Store

 Team signup to be posted on Canvas under ‘People’  Build off of Assignment 1 GenericNode  Focus on TCP client/server w/ replication  How to track membership for data replication?  Can implement multiple types of membership tracking for extra credit March 11, 2021 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18. ASSIGNMENT 2

[Winter 2021] School of Engineering and Technology, UW-Tacoma

 6.1 Clock Synchronization

 Physical clocks

 Clock synchronization algorithms

 6.2 Logical clocks

 Lamport clocks

 Vector clocks

 6.3 Mutual exclusion

 6.4 Election algorithms

 6.6 Distributed event matching (light)

 6.7 Gossip-based coordination (light)

March 11, 2021 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18.

CHAPTER 6 - COORDINATION

CH. 6.2: LOGICAL

CLOCKS

L18.

[Winter 2021] School of Engineering and Technology, UW-Tacoma  Provide a vector clock label for unlabeled events March 11, 2021 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18. VECTOR CLOCKS EXAMPLE - 3  TRUE/FALSE:  The sending of message m 3 is causally dependent on the sending of message m 1.  The sending of message m 2 is causally dependent on the sending of message m 1. March 11, 2021 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18. VECTOR CLOCKS EXAMPLE - 4

[Winter 2021] School of Engineering and Technology, UW-Tacoma

 Questions from 3/

 Assignment 2: Replicated Key Value Store

 Review: Activity 4 – Total Ordered Multicasting

 Chapter 6: Coordination

 Chapter 6.2: Vector Clocks

 Review: Activity 5 – Causality and Vector Clocks

 Chapter 6: Coordination

 Chapter 6.3: Distributed Mutual Exclusion

 Practice Final Exam Questions

March 11, 2021 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18.

OBJECTIVES – 3/

CH. 6.3: DISTRIBUTED

MUTUAL

EXCLUSION

L18.

[Winter 2021] School of Engineering and Technology, UW-Tacoma

 Coordinating access among distributed processes to a

shared resource requires Distributed Mutual Exclusion

 Algorithms in 6.

 Token-ring algorithm

 Permission-based algorithms:

 Centralized algorithm

 Distributed algorithm (Ricart and Agrawala)

 Decentralized voting algorithm (Lin et al.)

March 11, 2021 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18. DISTRIBUTED MUTUAL EXCLUSION ALGORITHMS

 Mutual exclusion by passing a “token” between nodes

 Nodes often organized in ring

 Only one token, holder has access to shared resource

 Avoids starvation: everyone gets a chance to obtain lock

 Avoids deadlock: easy to avoid

March 11, 2021 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18. TOKEN-BASED ALGORITHMS

[Winter 2021] School of Engineering and Technology, UW-Tacoma

 Permission-based algorithms

 Processes must require permission from other processes

before first acquiring access to the resource

 CONTRAST: Token-ring did not ask nodes for permission

 Centralized algorithm

 Elect a single leader node to coordinate access to shared

resource(s)

 Manage mutual exclusion on a distributed system similar

to how it mutual exclusion is managed for a single system

 Nodes must all interact with leader to obtain “the lock”

March 11, 2021 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18. DISTRIBUTED MUTUAL EXCLUSION ALGORITHMS - 3  When resource not available, coordinator can block the requesting process, or respond with a reject message  P2 must poll the coordinator if it responds with reject otherwise can wait if simply blocked  Requests granted permission fairly using FIFO queue  Just three messages: (request, grant (OK), release) March 11, 2021 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18. CENTRALIZED MUTUAL EXCLUSION P 1 executes P 2 blocks P 1 finishes; P 2 executes Permission granted from coordinator / No response from coordinator

[Winter 2021] School of Engineering and Technology, UW-Tacoma  Issues  Coordinator is a single point of failure  Processes can’t distinguish dead coordinator from “blocking” when resource is unavailable  No difference between CRASH and Block (for a long time)  Large systems, coordinator becomes performance bottleneck  Scalability: Performance does not scale  Benefits  Simplicity: Easy to implement compared to distributed alternatives March 11, 2021 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18. CENTRALIZED MUTUAL EXCLUSION - 2  Ricart and Agrawala [1981], use total ordering of all events  Leverages Lamport logical clocks  Package up resource request message (AKA Lock Request)  Send to all nodes  Include:  Name of resource  Process number  Current (logical) time  Assume messages are sent reliably  No messages are lost March 11, 2021 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18. DISTRIBUTED ALGORITHM

[Winter 2021] School of Engineering and Technology, UW-Tacoma

 Problem: Algorithm has N points of failure!

 Where N = Number of Nodes in the system

 No Reply Problem: When node is accessing the resource,

it does not respond

 Lack of response can be confused with failure

 Possible Solution: When node receives request for

resource it is accessing, always send a reply either

granting or denying permission (ACK)

 Enables requester to determine when nodes have died

March 11, 2021 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18. CHALLENGES WITH DISTRIBUTED ALGORITHM  Problem: Multicast communication required –or- each node must maintain full group membership  Track nodes entering, leaving, crashing…  Problem: Every process is involved in reaching an agreement to grant access to a shared resource  This approach may not scale on resource-constrained systems  Solution: Can relax total agreement requirement and proceed when a simple majority of nodes grant permission  Presumably any one node locking the resource prevents agreement  If one node gets majority of acknowledges no other can  Requires every node to know size of system (# of nodes)  Distributed algorithm for mutual exclusion works best for:  Small groups of processes  When memberships rarely change March 11, 2021 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18. CHALLENGES WITH DISTRIBUTED ALGORITHM - 2

[Winter 2021] School of Engineering and Technology, UW-Tacoma

 Lin et al. [2004], decentralized voting algorithm

 Resource is replicated N times

 Each replica has its own coordinator …(N coordinators)

 Accessing resource requires majority vote:

total votes (m) > N/2 coordinators

 Assumption #1: When coordinator does not give

permission to access a resource (because it is busy) it will

inform the requester

March 11, 2021 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18. DECENTRALIZED ALGORITHM  Assumption #2: When a coordinator crashes, it recovers quickly, but will have forgotten votes before the crash.  Approach assumes coordinators reset arbitrarily at any time  Risk: on crash, coordinator forgets it previously granted permission to the shared resource, and on recovery it errantly grants permission again  The Hope: if coordinator crashes, upon recover y, the node granted access to the resource has already f inished before the restored coordinator grants access again... March 11, 2021 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18. DECENTRALIZED ALGORITHM - 2

[Winter 2021] School of Engineering and Technology, UW-Tacoma WE WILL RETURN AT 3:01 PM October 24, 2016 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18.

[Winter 2021] School of Engineering and Technology, UW-Tacoma October 24, 2016 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18. October 24, 2016 TCSS558: Applied Distributed Computing [Winter 2021] School of Engineering and Technology, University of Washington - Tacoma L18.