• No results found

Software Replication

N/A
N/A
Protected

Academic year: 2021

Share "Software Replication"

Copied!
20
0
0

Loading.... (view fulltext now)

Full text

(1)
(2)

Motivation

Assure the availability of an object (service) despite

failures

Assuming p the failure probability of an object O.

O’s availability is 1-p.

Replicating an object O on n nodes and assuming p

the failure probability of each replica, O’s availability

is

1-

p

n

(3)

Linearizability In a Shared

Memory System

x write(a) p

1

ok()

x read() p

1

ok(b)

p

1 1. LINEARIZZABILE 3

x write(b) p

2

ok()

p

2

x write(a) p

1

ok()

x write(b) p

2

ok()

x read() p

1

ok(a)

p

1

p

2 2. NON LINEARIZZABILE

(4)

Linearizability

Liveness

Liveness

: every invocation has a

matching response

Safety

Safety:

:

there exists a

permutation P of all operations on

permutation P of all operations on

O such that

(5)

Replication Techniques

Due main techniques

implementing linearizability:

Primary

Primary Backup

Backup

5

Primary

Primary Backup

Backup

(6)

Sistem Model

Processes are either clients or replicas

Clients and replicas exchanges messages through Perfect

point-point links

Processes can crash

Processes can crash

(7)

Passive replication:

Primary-Backup

(8)

Primary Backup

Primary

Primary

:

Receives invocations from clients and

sends back the answers.

Given an object x

x,

prim

prim((

x

x

)

)

returns the

primary of x.

x.

Backup:

Backup:

Interacts with

prim

prim((

x

x

)

)

is used to guarantee fault tolerance by

(9)

Primary Backup Scenario

(10)

Primary Backup: the case of no crash

When update messages are received by

backups, they update their state and send

back the ack to

prim

prim((

x

x

))

.

prim

prim((

x

x

)

) waits

waits

for an ack message from

prim

prim((

x

x

)

) waits

waits

for an ack message from

each correct

backup and

backup and then

then sends

sends back

back

the

the answer

answer

,

res

res

, to the client.

Guarantee Linearizability

: the order in

(11)

Primary Backup: Presence of Crash

Three scenarios

::

1.

Scenario 1

: Primary fails after the client

receives the answer.

2.

Scenario 2

: Primary fails before sending

update messages

11

update messages

3.

Scenario 3

: Primary fails after sending

update messages and before receiving all

the ack messages.

In all cases there is the need of electing a

(12)

Scenario 1

Primary fails after the client receives the answer:

Client could not receive the response due to perfect

(13)

Scenario 2

13

Primary fails before sending update messages

Client does not get an answer and resends the

requests after a timeout

(14)

Scenario 3

Primary fails after sending update messages and

(15)

Example of Primary Backup on

Synchronous Systems

USE

Perfect Point-to-point link; rb broadcast, leader election; perfect failure detector;

upon event <Init> do

recovery:= false; primary:=p; state:=initial; storage:= Ø; lastreq:=(-,-,-,-,initial);

ack_recovery:=Ø; correct:=Π;

upon event < pp2pdeliver | client, [request(arg,sn]>

Upon <rbdeliver|[up(sn,c,arg,result,newstate)]> do

lastreq := (sn,c,arg,result,newstate); state:=newstate;

store (sn,c,arg,result,newstate) into storage;

trigger <pp2psend | primary, [ack(sn,c)]>;

upon event <crash| p > do

correct:=correct-p;

if p=primary

then trigger <leaderelection> ;

upon event < pp2pdeliver | client, [request(arg,sn]>

and not recovery do If (sn,c,arg) in storage

then result:=retrieve(sn,c,arg)from storage

trigger <pp2psend | c, [response(result)]>

else (result,new state):= execute request(arg)

trigger <rbBcast|[up(sn,c,arg,result,newstate)]>; state:=newstate;

create(ack_setc,sn); ack_setc,sn:= Ø;

Upon event <pp2pdeliver | replica, ack(c,sn)> ack_setc,sn:= ack_setc,sn U replica;

Upon event acksetc,sn ⊇ correct do

store (sn,c,arg,result,newstate) intostorage;

trigger <pp2psend | c, [response(result)]>;

Upon event ack_recovery ⊇ correct do

recovery:=false;

then trigger <leaderelection> ;

upon event <leader| p> do if p=myself

then recovery:= true;

trigger <rbbcast | [recovery(lastreq)]>;

register the primary to a name server;

Upon <rbdeliver | [recovery(lastreq)]> do if state ≠ lastreq.state

then remove lastreq from storage; state:=lastreq.state;

trigger <pp2psend | primary, [ack_rec]>;

Upon event <pp2pdeliver | replica, ack_recovery> ack_recovery:= ack_recovery U replica;

(16)
(17)

Active Replication

There is no coordinator all replicas have the same role

Each replica is deterministic. If any replica starts from the

same state and receives the same input, they will produce

the same output

As a matter of fact clients will receive the same response

17

As a matter of fact clients will receive the same response

one from each replica

(18)
(19)

Active Replication:

Garantire Linearizability

To ensure linearlizability we need to preserve:

Atomicity

Atomicity

: if a replica executes an invocation, all

correct replicas execute the same invocation.

Ordering

Ordering

: (at least) no two correct replicas have to

19

Ordering

Ordering

: (at least) no two correct replicas have to

execute two invocations in different order.

We need:

TOTAL ORDER Broadcast

(20)

Active Replication:Crash

Active Replication does not need

recovery action upon the failure of a

replica

References

Related documents

Existing users will also want to then update the software on the client machines and use one of the updated clients to update their vault data as instructed in the Convert Files

[r]

An increase of the number of foreshocks of type I as a function of the mainshock magnitude is observed in our numerical simulations (see Figure 5) because, as we explained before,

Cíle této aplikace jsou stanovené tak, aby byly splněné všechny principy definované počítačovou terapií (Kapitola 2.1.1). Konkrétní cíl této aplikace je

The performance of the DHCP client can be impacted when the Dynamic DNS Support for Cisco IOS Software feature is enabled, because of sending DDNS update packets and waiting

probability function (6) and the deterministic part of the choice utility (7) are as follows: 16 (4) (5) (6) Price Story Grape Variety Label Choice Utility Expected quality

The client computer always connects to WSUS running on the software update point to retrieve the software updates metadata before the client computer scans for software

If the connected device is capable of sending ASCII text strings to the modem, then you can use it to issue commands, which will send specific messages that are stored on the sim