• No results found

Distributed Computing. Using multiple sites to solve a problem

N/A
N/A
Protected

Academic year: 2021

Share "Distributed Computing. Using multiple sites to solve a problem"

Copied!
73
0
0

Loading.... (view fulltext now)

Full text

(1)

Distributed Computing

(2)

Distributed Computing

Using multiple sites to solve a problem

(3)

Distributed Computing

Using multiple sites to solve a problem

(4)

Distributed Computing

Using multiple sites to solve a problem

Network filesystem Cloud computing

(5)

Distributed Computing

Using multiple sites to solve a problem

Network filesystem Cloud computing

(6)

Distributed Computing

Using multiple sites to solve a problem

Network filesystem Cloud computing

Multi-player game Collaborative spreadsheet

(7)

Distributed Computing

Using multiple sites to solve a problem

Network filesystem Cloud computing

Multi-player game Collaborative spreadsheet

(8)

Distributed Computing

Using multiple sites to solve a problem

Network filesystem Cloud computing

Multi-player game Collaborative spreadsheet

E-commerce site Scientific simulation

(9)

Distributed Computing

Using multiple sites to solve a problem

Network filesystem Cloud computing

Multi-player game Collaborative spreadsheet

E-commerce site Scientific simulation

(10)

Distributed Computing

Different applications ⇒ different levels of transparency:

• Hardware as a service: use of multiple computer is automatic for each application

• Volcano-monitoring sensors: distribution and communication explicit in the application

Different applications ⇒ same core problems:

(11)

Happens Before

(12)

Virtual Clocks

<wizard image> <knight image> <dragon image>

mumbling sleeping

muttering breathing fire

(13)

Virtual Clocks

<wizard image> <knight image> <dragon image>

mumbling sleeping

muttering

(14)

Virtual Clocks

<wizard image> <knight image> <dragon image>

mumbling sleeping

muttering sheilding

(15)

Virtual Clocks

<wizard image> <knight image> <dragon image>

mumbling @ 0 sleeping @ 0

muttering @ 1 sheilding @ 2

(16)

Virtual Clocks

<wizard image> <knight image> <dragon image>

mumbling @ 0 sleeping @ 0

muttering @ 1 sheilding @ 2

(17)
(18)

Centralized Lock

One site manages a given lock Advantages:

• Simple to implement • Easy to make fair Disadvantages:

(19)

Distributed Lock

Ask everyone else’s permission for lock Advantages:

Disadvantages:

• Lots of communication

(20)

Majority Lock

Ask permission from more than 50% for lock Advantages:

• Handles failure of sites well

• Less communication than asking everyone Disadvantages:

(21)

Token Ring

Wait for permission, then pass it on afterward Advantages:

• Relatively little communication • Clearly fair

• Makes sense when permission is needed often Disadvantages:

• Have to set up ring

• Single failure breaks the ring

(22)

Elections

In case sites need to pick a new coordinator (e.g., for a lock)

• Bully algorithm • Ring algorithm

(23)

Bully Algorithm

Rank all sites

• If a process i doesn’t hear back from a coordinator:

Send an elect message to every j > i

No responses? Then i considers itself elected and notifies everyone

Got response? Wait for notify from new coodinator...

• If a process i receives an elect message, treat it

(24)

Bully Algorithm

1

(25)

Bully Algorithm

1

(26)

Bully Algorithm

2

(27)

Bully Algorithm

2

wait on 4

(28)

Bully Algorithm

2

elect 2!

(29)

Bully Algorithm

2 elect 2? 4 3 elect 3! 4
(30)

Bully Algorithm

2 elect 2? 4 3 inaug 3 4
(31)

Bully Algorithm

2

(32)

Bully Algorithm

1 2

(33)

Bully Algorithm

1

elect 1!

2

(34)

Bully Algorithm

1 elect 1? 2 elect 2! 3 3 3
(35)

Bully Algorithm

1 elect 1? 2 elect 2? 3 3 elect 3! 3
(36)

Bully Algorithm

1

(37)

Bully Algorithm

1

(38)

Bully Algorithm

1

3 2 3 3 3 4

(39)

Bully Algorithm

1

3 2 3 3 3 4

(40)

Bully Algorithm

1

(41)

Ring Algorithm

When communication is always to the next live site • If a process i doesn’t hear back from a

coordinator:

Send an elect message to neighbor

Accumulate elect messages to learn about

live sites

(42)

Ring Algorithm

1

(43)

Ring Algorithm

1

(44)

Ring Algorithm

2

(45)

Ring Algorithm

2

wait on 4

(46)

Ring Algorithm

2

[2,...] elect(2)

(47)

Ring Algorithm

2 [2] 4 3 [2,3,...] elect(3) elect(2) 4
(48)

Ring Algorithm

2 [2,3,...] elect(3) 4 3 [2,3,...] elect(2) 4
(49)

Ring Algorithm

2 [2,3] elect(3) 4 3 [2,3,...] 4
(50)

Ring Algorithm

2 [2,3] 4 3 [2,3] 4
(51)

Ring Algorithm

2

(52)
(53)

Multi-Site Atomicity

<buyer image> <seller image>

(54)

Two-Phase Commit

<buyer image>

T1:

<seller image>

(55)

Two-Phase Commit

<buyer image> T1: <seller image> T1: <bank image> T1:
(56)

Two-Phase Commit

<buyer image> T1: <seller image> T1: <bank image>
(57)

Two-Phase Commit

<buyer image> T1: <seller image> T1: give keys <bank image> T1: transfer money
(58)

Two-Phase Commit

<buyer image> T1: take keys <seller image> T1: give keys <bank image>
(59)

Two-Phase Commit

<buyer image> T1: take keys <seller image> T1: give keys
(60)

Two-Phase Commit

<buyer image> T1: take keys <seller image> T1: give keys <bank image>
(61)

Two-Phase Commit

<buyer image> T1: take keys <prepare> <seller image> T1: give keys <bank image> T1: transfer money
(62)

Two-Phase Commit

<buyer image> T1: take keys <prepare> <seller image> T1: give keys <ready> <bank image>
(63)

Two-Phase Commit

<buyer image> T1: take keys <prepare> <seller image> T1: give keys <ready>
(64)

Two-Phase Commit

<buyer image> T1: take keys <prepare> <fail> <seller image> T1: give keys <ready>
(65)

Two-Phase Commit

<buyer image> T1: take keys <prepare> <fail> <seller image> T1: give keys <ready> <fail>
(66)

Two-Phase Commit

<buyer image> T1: take keys <prepare> <seller image> T1: give keys <ready> <bank image>
(67)

Two-Phase Commit

<buyer image> T1: take keys <prepare> <seller image> T1: give keys <ready> <bank image> T1: transfer money <ready>
(68)

Two-Phase Commit

<buyer image> T1: take keys <prepare> <commit> <seller image> T1: give keys <ready> <bank image>
(69)

Two-Phase Commit

<buyer image> T1: take keys <prepare> <commit> <seller image> T1: give keys <ready> <commit> <bank image> T1: transfer money <ready>
(70)

Two-Phase Commit

<buyer image> T1: take keys <prepare> <commit> <seller image> T1: give keys <ready> <commit>
(71)

Two-Phase Commit

<buyer image> T1: take keys <prepare> <commit> <seller image> T1: give keys <ready> <commit> <bank image> T1: transfer money <ready>
(72)

Two-Phase Commit

<buyer image> T1: take keys <prepare> <commit> <seller image> T1: give keys <ready> <commit> <bank image>
(73)

Things You Can’t Do

• Two-way common knowledge

e.g., buyers commit only if they know that the bank received the message to finalize the

transaction

• Handle too many byzantine failures

Can use voting to detect when up to 1/3 of the sites are faulty, but not when more are faulty

References

Related documents

s-process p-process Mass known Half-life known

Plant survival of globally engaged firms, such as Swedish MNEs and exporting non- MNEs, seems to be unaffected by increased foreign presence, whereas there appears to be a

Volume (2018), Issue 1 Spring 2018 Wildlife Sightings Newsletter of the Iowa Chapter of The Wildlife Society. Make TWS Journals Your Publishing Choice

Advantage: Tungsten carbide, TSP, and diamond enhanced inserts provide extra protection to the gauge. Benefit: In-gauge hole and longer bit life;

To address these questions, the following goals were set: (a) to reproduce field explosions pertaining to primary blast injury as accurate as possible in a controlled

In memory of Harold Taub, beloved husband of Paula Taub by: Karen &amp; Charles Rosen.. Honouring Maria Belenkova-Buford on her marriage by: Karen &amp;

If Sudan wants to compete in the international meat market it will compete with countries that are producing at the lowest cost and high quality. For example Australia

“ the seven words of our LORD on