SlideShare una empresa de Scribd logo
1 de 20
Global State Recording
Distributed Systems

Hamed Naeemaei

1
Models of communication
1.

In FIFO model, each channel acts as a first-in first-out message queue

and thus, message ordering is preserved by a channel.
2.

In non-FIFO model, a channel acts like a set in which the sender
process adds messages and the receiver process removes messages
from it in a random order.

3.

A system that supports causal delivery of messages satisfies the
following property:
“For any two messages mij and mkj , if send(mij ) −→ send(mkj ), then rec(mij ) −→ rec(mkj )”.

2
System model
• Cij denotes the channel from process Pi to process Pj and

its state is denoted by SCij .
• At any instant, the state of process Pi , denoted by LSi
• The actions performed by a process are modeled as three
types of events: Internal events , the message send
event and the message receive event.

3
Consistent global state

4
Cuts
Instant of local
observation

Time

P1
5

8
3

initial
value

P2
5

3

2

7

4
1

P3
4

5
ideal
(vertical)
cut
(15)
not attainable

0
consistent
cut
(15)

equivalent to a vertical cut
(rubber band transformation)

inconsistent
cut
(19)
can’t be made vertical
(message from the future)

5
Issues in recording a global state
I1: How to distinguish between the messages to be recorded
in the snapshot from those not to be recorded.
– Any message that is sent by a process before recording its
snapshot, must be recorded in the global snapshot (from C1).
– Any message that is sent by a process after recording its
snapshot, must not be recorded in the global snapshot (from C2).

I2: How to determine the instant when a process takes its
snapshot.
– A process must record its snapshot before processing a message
that was sent by process after recording its snapshot.

6
Spezialetti-Kearns algorithm(FIFO)
Chandy-Lamport Extension
 Exploit concurrently initiated snapshots to reduce overhead of local
snapshot exchange

• There are two phases in obtaining a global
snapshot: locally recording the snapshot at every
process and distributing the resultant global
snapshot to all the initiators.
snapshot recording :
• In the Spezialetti-Kearns algorithm, a markers
carries the identifier of the initiator of the
algorithm.
• Each process has a variable master to keep track of
the initiator of the algorithm.
7
Spezialetti-Kearns algorithm(FIFO)
Chandy-Lamport Extension
• A key notion used by the optimizations is that of a
region in the system. A region encompasses all the
processes whose master field contains the
identifier of the same initiator.
• The identifier of the concurrent initiator is
recorded in a local variable id-border -set.

8
Spezialetti-Kearns algorithm (cont.)
• The state of the channel is recorded just as in the
Chandy-Lamport algorithm.
• Snapshot recording at a process is complete after
it has received a marker along each of its
channels.
• After every process has recorded its snapshot,
the system is partitioned into as many regions as
the number of concurrent initiations of the
algorithm.
• Variable id-border-set at a process contains the
identifiers of the neighboring regions.
9
Spezialetti-Kearns algorithm (cont.)
Efficient dissemination of the recorded
snapshot
• In the snapshot recording phase, a forest of
spanning trees is implicitly created in the system.
The initiator of the algorithm is the root of a
spanning tree and all processes in its region
belong to its spanning tree.

10
Spezialetti-Kearns algorithm (cont.)
1) If Pi receives its first marker from Pj then: process Pj is the
parent of process Pi in the spanning tree.
2) When an intermediate process in a spanning tree has
received the recorded states from all its child processes
and has recorded the states of all incoming channels, it
forwards its locally recorded state and the locally recorded
states of all its descendent processes to its parent.
11
Spezialetti-Kearns algorithm (cont.)
3)

When the initiator receives the locally recorded states
of all its descendants from its children processes, it
assembles the snapshot for all the processes in its

region and the channels incident on these processes.

4)

The initiator exchanges the snapshot of its region with
the initiators in adjacent regions in rounds.
12
Spezialetti-Kearns algorithm (cont.)
Example

13
Snapshot Algorithms for Non-FIFO Channels
Lai-Yang Algorithm

• In a non-FIFO system, a marker cannot be used to
delineate messages into those to be recorded in the
global state from those not to be recorded in the
global state.
• In a non-FIFO system, either some degree of
inhibition or piggybacking of control information on
computation messages to capture out-of-sequence
messages is necessary to record a consistent global
snapshot.
• The Lai-Yang algorithm fulfills this role of a marker in
a non-FIFO system by using a coloring scheme on
computation messages that works as follows:
14
Snapshot Algorithms for Non-FIFO Channels
Lai-Yang Algorithm

– Every process is initially white and turns red while
taking a snapshot. The equivalent of the “Marker
Sending Rule” is executed when a process turns red.
– Every message sent by a white (red) process is
colored white (red).
– Thus, a white (red) message is a message that was
sent before (after) the sender of that message
recorded its local snapshot.
– Every white process takes its snapshot at its
convenience, but no later than the instant it
receives a red message.
15
Snapshot Algorithms for Non-FIFO Channels
Lai-Yang Algorithm

send (mij ) | send (mij ) LSi

rec(mij ) | rec(mij ) LS j

16
Snapshot Algorithms for Non-FIFO Channels
Lai-Yang Algorithm
Example

P
rw
rr

ww
wr
Q

17
Snapshot Algorithms for Non-FIFO Channels
Mattern’s Algorithm
• Mattern’s algorithm is based on vector clocks and assumes a single initiator
process and works as follows:
– The initiator “ticks” its local clock and selects a future vector time s at which it
would like a global snapshot to be recorded. It then broadcasts this time s and
freezes all activity until it receives all acknowledgements of the receipt of this

broadcast.
– When a process receives the broadcast, it remembers the value s and returns an
acknowledgement to the initiator.
– After having received an acknowledgement from every process, the initiator
increases its vector clock to s and broadcasts a dummy message to all processes.
18
Snapshot Algorithms for Non-FIFO Channels
Mattern’s Algorithm

– The receipt of this dummy message forces each
recipient to increase its clock to a value ≥ s if not
already ≥ s.
– Each process takes a local snapshot and sends it to
the initiator when (just before) its clock increases
from a value less than s to a value ≥ s.
– The state of Cij is all messages sent along Cij , whose
timestamp is smaller than s and which are received by
Pj after recording LSj .
19
20

Más contenido relacionado

La actualidad más candente

clock synchronization in Distributed System
clock synchronization in Distributed System clock synchronization in Distributed System
clock synchronization in Distributed System Harshita Ved
 
Distributed Mutual Exclusion and Distributed Deadlock Detection
Distributed Mutual Exclusion and Distributed Deadlock DetectionDistributed Mutual Exclusion and Distributed Deadlock Detection
Distributed Mutual Exclusion and Distributed Deadlock DetectionSHIKHA GAUTAM
 
Transactions and Concurrency Control
Transactions and Concurrency ControlTransactions and Concurrency Control
Transactions and Concurrency ControlDilum Bandara
 
01 knapsack using backtracking
01 knapsack using backtracking01 knapsack using backtracking
01 knapsack using backtrackingmandlapure
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSKathirvel Ayyaswamy
 
Lexical analyzer generator lex
Lexical analyzer generator lexLexical analyzer generator lex
Lexical analyzer generator lexAnusuya123
 
Deadlock Detection
Deadlock DetectionDeadlock Detection
Deadlock DetectionStuart Joy
 
Physical and Logical Clocks
Physical and Logical ClocksPhysical and Logical Clocks
Physical and Logical ClocksDilum Bandara
 
Day 2 global_state_and_snapshot_algorithms
Day 2 global_state_and_snapshot_algorithmsDay 2 global_state_and_snapshot_algorithms
Day 2 global_state_and_snapshot_algorithmsVI Ni
 
Synchronization in distributed computing
Synchronization in distributed computingSynchronization in distributed computing
Synchronization in distributed computingSVijaylakshmi
 
RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure callSunita Sahu
 
Design issues of dos
Design issues of dosDesign issues of dos
Design issues of dosvanamali_vanu
 
Lamport’s algorithm for mutual exclusion
Lamport’s algorithm for mutual exclusionLamport’s algorithm for mutual exclusion
Lamport’s algorithm for mutual exclusionNeelamani Samal
 

La actualidad más candente (20)

Distributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithmsDistributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithms
 
clock synchronization in Distributed System
clock synchronization in Distributed System clock synchronization in Distributed System
clock synchronization in Distributed System
 
Distributed Mutual Exclusion and Distributed Deadlock Detection
Distributed Mutual Exclusion and Distributed Deadlock DetectionDistributed Mutual Exclusion and Distributed Deadlock Detection
Distributed Mutual Exclusion and Distributed Deadlock Detection
 
6.distributed shared memory
6.distributed shared memory6.distributed shared memory
6.distributed shared memory
 
Transactions and Concurrency Control
Transactions and Concurrency ControlTransactions and Concurrency Control
Transactions and Concurrency Control
 
6.Distributed Operating Systems
6.Distributed Operating Systems6.Distributed Operating Systems
6.Distributed Operating Systems
 
01 knapsack using backtracking
01 knapsack using backtracking01 knapsack using backtracking
01 knapsack using backtracking
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 
Lexical analyzer generator lex
Lexical analyzer generator lexLexical analyzer generator lex
Lexical analyzer generator lex
 
Monitors
MonitorsMonitors
Monitors
 
Deadlock Detection
Deadlock DetectionDeadlock Detection
Deadlock Detection
 
Physical and Logical Clocks
Physical and Logical ClocksPhysical and Logical Clocks
Physical and Logical Clocks
 
Sliding window protocol
Sliding window protocolSliding window protocol
Sliding window protocol
 
Day 2 global_state_and_snapshot_algorithms
Day 2 global_state_and_snapshot_algorithmsDay 2 global_state_and_snapshot_algorithms
Day 2 global_state_and_snapshot_algorithms
 
Synchronization in distributed computing
Synchronization in distributed computingSynchronization in distributed computing
Synchronization in distributed computing
 
RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure call
 
message passing
 message passing message passing
message passing
 
Design issues of dos
Design issues of dosDesign issues of dos
Design issues of dos
 
Lamport’s algorithm for mutual exclusion
Lamport’s algorithm for mutual exclusionLamport’s algorithm for mutual exclusion
Lamport’s algorithm for mutual exclusion
 

Similar a Recording Global States in Distributed Systems

Flexible Symmetric Global Snapshot
Flexible Symmetric Global Snapshot Flexible Symmetric Global Snapshot
Flexible Symmetric Global Snapshot Ashutosh Jaiswal
 
DISTRIBUTED COMPUTTING (snapshot).pptx
DISTRIBUTED COMPUTTING (snapshot).pptxDISTRIBUTED COMPUTTING (snapshot).pptx
DISTRIBUTED COMPUTTING (snapshot).pptx950621104027GODWINJ
 
Design and analysis of algorithm chapter two.pptx
Design and analysis of algorithm chapter two.pptxDesign and analysis of algorithm chapter two.pptx
Design and analysis of algorithm chapter two.pptxTekle12
 
SAND: A Fault-Tolerant Streaming Architecture for Network Traffic Analytics
SAND: A Fault-Tolerant Streaming Architecture for Network Traffic AnalyticsSAND: A Fault-Tolerant Streaming Architecture for Network Traffic Analytics
SAND: A Fault-Tolerant Streaming Architecture for Network Traffic AnalyticsQin Liu
 
Control unit design
Control unit designControl unit design
Control unit designDhaval Bagal
 
SAMPLE FOR MICRO PROGRAMMING CO_-_7th_UNIT.pdf
SAMPLE FOR MICRO PROGRAMMING CO_-_7th_UNIT.pdfSAMPLE FOR MICRO PROGRAMMING CO_-_7th_UNIT.pdf
SAMPLE FOR MICRO PROGRAMMING CO_-_7th_UNIT.pdfDrKalaavathiBuvanesh
 
Micro operation control of processor
Micro operation control of processorMicro operation control of processor
Micro operation control of processorMuhammad Ishaq
 
slides-main.pdf
slides-main.pdfslides-main.pdf
slides-main.pdfMatupi1
 
Control Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unitControl Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unitabdosaidgkv
 
Exploiting parallelism opportunities in non-parallel architectures to improve...
Exploiting parallelism opportunities in non-parallel architectures to improve...Exploiting parallelism opportunities in non-parallel architectures to improve...
Exploiting parallelism opportunities in non-parallel architectures to improve...GreenLSI Team, LSI, UPM
 
Synchronization
SynchronizationSynchronization
SynchronizationSara shall
 
Embedded systems and robotics by scmandota
Embedded systems and robotics by scmandotaEmbedded systems and robotics by scmandota
Embedded systems and robotics by scmandotascmandota
 

Similar a Recording Global States in Distributed Systems (20)

Flexible Symmetric Global Snapshot
Flexible Symmetric Global Snapshot Flexible Symmetric Global Snapshot
Flexible Symmetric Global Snapshot
 
DISTRIBUTED COMPUTTING (snapshot).pptx
DISTRIBUTED COMPUTTING (snapshot).pptxDISTRIBUTED COMPUTTING (snapshot).pptx
DISTRIBUTED COMPUTTING (snapshot).pptx
 
Design and analysis of algorithm chapter two.pptx
Design and analysis of algorithm chapter two.pptxDesign and analysis of algorithm chapter two.pptx
Design and analysis of algorithm chapter two.pptx
 
Computer Organization
Computer OrganizationComputer Organization
Computer Organization
 
SAND: A Fault-Tolerant Streaming Architecture for Network Traffic Analytics
SAND: A Fault-Tolerant Streaming Architecture for Network Traffic AnalyticsSAND: A Fault-Tolerant Streaming Architecture for Network Traffic Analytics
SAND: A Fault-Tolerant Streaming Architecture for Network Traffic Analytics
 
Digital-Unit-III.ppt
Digital-Unit-III.pptDigital-Unit-III.ppt
Digital-Unit-III.ppt
 
Control unit design
Control unit designControl unit design
Control unit design
 
ch 2 - DISTRIBUTED DEADLOCK DETECTION.pptx
ch 2 - DISTRIBUTED DEADLOCK DETECTION.pptxch 2 - DISTRIBUTED DEADLOCK DETECTION.pptx
ch 2 - DISTRIBUTED DEADLOCK DETECTION.pptx
 
SAMPLE FOR MICRO PROGRAMMING CO_-_7th_UNIT.pdf
SAMPLE FOR MICRO PROGRAMMING CO_-_7th_UNIT.pdfSAMPLE FOR MICRO PROGRAMMING CO_-_7th_UNIT.pdf
SAMPLE FOR MICRO PROGRAMMING CO_-_7th_UNIT.pdf
 
운영체제론 Ch16
운영체제론 Ch16운영체제론 Ch16
운영체제론 Ch16
 
Micro operation control of processor
Micro operation control of processorMicro operation control of processor
Micro operation control of processor
 
slides-main.pdf
slides-main.pdfslides-main.pdf
slides-main.pdf
 
Central processing unit i
Central processing unit iCentral processing unit i
Central processing unit i
 
Control Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unitControl Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unit
 
Exploiting parallelism opportunities in non-parallel architectures to improve...
Exploiting parallelism opportunities in non-parallel architectures to improve...Exploiting parallelism opportunities in non-parallel architectures to improve...
Exploiting parallelism opportunities in non-parallel architectures to improve...
 
Grds conferences icst and icbelsh (9)
Grds conferences icst and icbelsh (9)Grds conferences icst and icbelsh (9)
Grds conferences icst and icbelsh (9)
 
Synchronization
SynchronizationSynchronization
Synchronization
 
p2 p grid
 p2 p grid  p2 p grid
p2 p grid
 
Embedded systems and robotics by scmandota
Embedded systems and robotics by scmandotaEmbedded systems and robotics by scmandota
Embedded systems and robotics by scmandota
 
Arm
ArmArm
Arm
 

Último

Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptxJonalynLegaspi2
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 

Último (20)

Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 

Recording Global States in Distributed Systems

  • 1. Global State Recording Distributed Systems Hamed Naeemaei 1
  • 2. Models of communication 1. In FIFO model, each channel acts as a first-in first-out message queue and thus, message ordering is preserved by a channel. 2. In non-FIFO model, a channel acts like a set in which the sender process adds messages and the receiver process removes messages from it in a random order. 3. A system that supports causal delivery of messages satisfies the following property: “For any two messages mij and mkj , if send(mij ) −→ send(mkj ), then rec(mij ) −→ rec(mkj )”. 2
  • 3. System model • Cij denotes the channel from process Pi to process Pj and its state is denoted by SCij . • At any instant, the state of process Pi , denoted by LSi • The actions performed by a process are modeled as three types of events: Internal events , the message send event and the message receive event. 3
  • 5. Cuts Instant of local observation Time P1 5 8 3 initial value P2 5 3 2 7 4 1 P3 4 5 ideal (vertical) cut (15) not attainable 0 consistent cut (15) equivalent to a vertical cut (rubber band transformation) inconsistent cut (19) can’t be made vertical (message from the future) 5
  • 6. Issues in recording a global state I1: How to distinguish between the messages to be recorded in the snapshot from those not to be recorded. – Any message that is sent by a process before recording its snapshot, must be recorded in the global snapshot (from C1). – Any message that is sent by a process after recording its snapshot, must not be recorded in the global snapshot (from C2). I2: How to determine the instant when a process takes its snapshot. – A process must record its snapshot before processing a message that was sent by process after recording its snapshot. 6
  • 7. Spezialetti-Kearns algorithm(FIFO) Chandy-Lamport Extension  Exploit concurrently initiated snapshots to reduce overhead of local snapshot exchange • There are two phases in obtaining a global snapshot: locally recording the snapshot at every process and distributing the resultant global snapshot to all the initiators. snapshot recording : • In the Spezialetti-Kearns algorithm, a markers carries the identifier of the initiator of the algorithm. • Each process has a variable master to keep track of the initiator of the algorithm. 7
  • 8. Spezialetti-Kearns algorithm(FIFO) Chandy-Lamport Extension • A key notion used by the optimizations is that of a region in the system. A region encompasses all the processes whose master field contains the identifier of the same initiator. • The identifier of the concurrent initiator is recorded in a local variable id-border -set. 8
  • 9. Spezialetti-Kearns algorithm (cont.) • The state of the channel is recorded just as in the Chandy-Lamport algorithm. • Snapshot recording at a process is complete after it has received a marker along each of its channels. • After every process has recorded its snapshot, the system is partitioned into as many regions as the number of concurrent initiations of the algorithm. • Variable id-border-set at a process contains the identifiers of the neighboring regions. 9
  • 10. Spezialetti-Kearns algorithm (cont.) Efficient dissemination of the recorded snapshot • In the snapshot recording phase, a forest of spanning trees is implicitly created in the system. The initiator of the algorithm is the root of a spanning tree and all processes in its region belong to its spanning tree. 10
  • 11. Spezialetti-Kearns algorithm (cont.) 1) If Pi receives its first marker from Pj then: process Pj is the parent of process Pi in the spanning tree. 2) When an intermediate process in a spanning tree has received the recorded states from all its child processes and has recorded the states of all incoming channels, it forwards its locally recorded state and the locally recorded states of all its descendent processes to its parent. 11
  • 12. Spezialetti-Kearns algorithm (cont.) 3) When the initiator receives the locally recorded states of all its descendants from its children processes, it assembles the snapshot for all the processes in its region and the channels incident on these processes. 4) The initiator exchanges the snapshot of its region with the initiators in adjacent regions in rounds. 12
  • 14. Snapshot Algorithms for Non-FIFO Channels Lai-Yang Algorithm • In a non-FIFO system, a marker cannot be used to delineate messages into those to be recorded in the global state from those not to be recorded in the global state. • In a non-FIFO system, either some degree of inhibition or piggybacking of control information on computation messages to capture out-of-sequence messages is necessary to record a consistent global snapshot. • The Lai-Yang algorithm fulfills this role of a marker in a non-FIFO system by using a coloring scheme on computation messages that works as follows: 14
  • 15. Snapshot Algorithms for Non-FIFO Channels Lai-Yang Algorithm – Every process is initially white and turns red while taking a snapshot. The equivalent of the “Marker Sending Rule” is executed when a process turns red. – Every message sent by a white (red) process is colored white (red). – Thus, a white (red) message is a message that was sent before (after) the sender of that message recorded its local snapshot. – Every white process takes its snapshot at its convenience, but no later than the instant it receives a red message. 15
  • 16. Snapshot Algorithms for Non-FIFO Channels Lai-Yang Algorithm send (mij ) | send (mij ) LSi rec(mij ) | rec(mij ) LS j 16
  • 17. Snapshot Algorithms for Non-FIFO Channels Lai-Yang Algorithm Example P rw rr ww wr Q 17
  • 18. Snapshot Algorithms for Non-FIFO Channels Mattern’s Algorithm • Mattern’s algorithm is based on vector clocks and assumes a single initiator process and works as follows: – The initiator “ticks” its local clock and selects a future vector time s at which it would like a global snapshot to be recorded. It then broadcasts this time s and freezes all activity until it receives all acknowledgements of the receipt of this broadcast. – When a process receives the broadcast, it remembers the value s and returns an acknowledgement to the initiator. – After having received an acknowledgement from every process, the initiator increases its vector clock to s and broadcasts a dummy message to all processes. 18
  • 19. Snapshot Algorithms for Non-FIFO Channels Mattern’s Algorithm – The receipt of this dummy message forces each recipient to increase its clock to a value ≥ s if not already ≥ s. – Each process takes a local snapshot and sends it to the initiator when (just before) its clock increases from a value less than s to a value ≥ s. – The state of Cij is all messages sent along Cij , whose timestamp is smaller than s and which are received by Pj after recording LSj . 19
  • 20. 20