SlideShare a Scribd company logo
7
Most read
8
Most read
18
Most read
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

More Related Content

PDF
8. mutual exclusion in Distributed Operating Systems
Dr Sandeep Kumar Poonia
 
PPTX
Physical and Logical Clocks
Dilum Bandara
 
DOC
Distributed Mutual exclusion algorithms
MNM Jain Engineering College
 
PPTX
Computer Network - Network Layer
Manoj Kumar
 
PPSX
Election algorithms
Ankush Kumar
 
PPT
program flow mechanisms, advanced computer architecture
Pankaj Kumar Jain
 
PPT
Logical Clocks (Distributed computing)
Sri Prasanna
 
PDF
management of distributed transactions
Nilu Desai
 
8. mutual exclusion in Distributed Operating Systems
Dr Sandeep Kumar Poonia
 
Physical and Logical Clocks
Dilum Bandara
 
Distributed Mutual exclusion algorithms
MNM Jain Engineering College
 
Computer Network - Network Layer
Manoj Kumar
 
Election algorithms
Ankush Kumar
 
program flow mechanisms, advanced computer architecture
Pankaj Kumar Jain
 
Logical Clocks (Distributed computing)
Sri Prasanna
 
management of distributed transactions
Nilu Desai
 

What's hot (20)

PPT
Clock synchronization in distributed system
Sunita Sahu
 
PPTX
Distributed shred memory architecture
Maulik Togadiya
 
PDF
8 memory management strategies
Dr. Loganathan R
 
PPTX
Semophores and it's types
Nishant Joshi
 
PPTX
Token Bus.pptx
MasterMan18
 
PPTX
Dynamic interconnection networks
Prasenjit Dey
 
PPTX
Open shortest path first (ospf)
Respa Peter
 
PPTX
Mobile Transport layer
Pallepati Vasavi
 
PPTX
Concurrency Control in Distributed Database.
Meghaj Mallick
 
PPTX
Distributed concurrency control
Binte fatima
 
PPTX
Distributed Mutual Exclusion and Distributed Deadlock Detection
SHIKHA GAUTAM
 
PPTX
Mutual Exclusion in Distributed Memory Systems
Dilum Bandara
 
PPT
Distributed Deadlock Detection.ppt
Babar Kamran Ahmed (LION)
 
PPT
Design issues for the layers
jayaprakash
 
PPTX
Python urllib
udhayakumarc1
 
PPT
11 distributed file_systems
longly
 
PPTX
Parallel processing
Praveen Kumar
 
PPTX
Distance Vector & Link state Routing Algorithm
MOHIT AGARWAL
 
PPTX
Network layer - design Issues
قصي نسور
 
Clock synchronization in distributed system
Sunita Sahu
 
Distributed shred memory architecture
Maulik Togadiya
 
8 memory management strategies
Dr. Loganathan R
 
Semophores and it's types
Nishant Joshi
 
Token Bus.pptx
MasterMan18
 
Dynamic interconnection networks
Prasenjit Dey
 
Open shortest path first (ospf)
Respa Peter
 
Mobile Transport layer
Pallepati Vasavi
 
Concurrency Control in Distributed Database.
Meghaj Mallick
 
Distributed concurrency control
Binte fatima
 
Distributed Mutual Exclusion and Distributed Deadlock Detection
SHIKHA GAUTAM
 
Mutual Exclusion in Distributed Memory Systems
Dilum Bandara
 
Distributed Deadlock Detection.ppt
Babar Kamran Ahmed (LION)
 
Design issues for the layers
jayaprakash
 
Python urllib
udhayakumarc1
 
11 distributed file_systems
longly
 
Parallel processing
Praveen Kumar
 
Distance Vector & Link state Routing Algorithm
MOHIT AGARWAL
 
Network layer - design Issues
قصي نسور
 
Ad

Similar to Global state recording in Distributed Systems (20)

PPTX
Flexible Symmetric Global Snapshot
Ashutosh Jaiswal
 
PPTX
DISTRIBUTED COMPUTTING (snapshot).pptx
950621104027GODWINJ
 
PPT
Presentation-1.ppt
vamsiKrishnasai3
 
PPT
Distributed System
Praveen Penumathsa
 
PPT
Distributed Snapshots
awesomesos
 
PDF
Day 2 global_state_and_snapshot_algorithms
VI Ni
 
PPTX
CST 402 Distributed Computing Module 2 Notes
sm8i4
 
PPT
Chapter 18 - Distributed Coordination
Wayne Jones Jnr
 
PPT
Chapter 14 replication
AbDul ThaYyal
 
PDF
Distributed computing time
Deepak John
 
PPTX
distribute system.
keerthikaA8
 
PPTX
OPERATING SYSTEMS PRESENTATION.pptx
PokormanZuda
 
PDF
Concurrency in Distributed Systems : Leslie Lamport papers
Subhajit Sahu
 
DOCX
Internet
Jack Nicole
 
PPT
Chapter00000000
Mani Deepak Choudhry
 
PDF
Tech Talk @ Google on Flink Fault Tolerance and HA
Paris Carbone
 
PPTX
Checkpointing.pptx
AzmiNizar1
 
PPT
Ch17 OS
C.U
 
PPT
OSCh17
Joe Christensen
 
Flexible Symmetric Global Snapshot
Ashutosh Jaiswal
 
DISTRIBUTED COMPUTTING (snapshot).pptx
950621104027GODWINJ
 
Presentation-1.ppt
vamsiKrishnasai3
 
Distributed System
Praveen Penumathsa
 
Distributed Snapshots
awesomesos
 
Day 2 global_state_and_snapshot_algorithms
VI Ni
 
CST 402 Distributed Computing Module 2 Notes
sm8i4
 
Chapter 18 - Distributed Coordination
Wayne Jones Jnr
 
Chapter 14 replication
AbDul ThaYyal
 
Distributed computing time
Deepak John
 
distribute system.
keerthikaA8
 
OPERATING SYSTEMS PRESENTATION.pptx
PokormanZuda
 
Concurrency in Distributed Systems : Leslie Lamport papers
Subhajit Sahu
 
Internet
Jack Nicole
 
Chapter00000000
Mani Deepak Choudhry
 
Tech Talk @ Google on Flink Fault Tolerance and HA
Paris Carbone
 
Checkpointing.pptx
AzmiNizar1
 
Ch17 OS
C.U
 
Ad

Recently uploaded (20)

PPTX
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
PPTX
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
PPTX
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
PPTX
A Smarter Way to Think About Choosing a College
Cyndy McDonald
 
PPTX
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
PPTX
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
PDF
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PPTX
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PDF
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
PPTX
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
PPTX
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
PPTX
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
PPTX
Gupta Art & Architecture Temple and Sculptures.pptx
Virag Sontakke
 
PPTX
Virus sequence retrieval from NCBI database
yamunaK13
 
DOCX
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
PPTX
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
PPTX
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
A Smarter Way to Think About Choosing a College
Cyndy McDonald
 
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
Gupta Art & Architecture Temple and Sculptures.pptx
Virag Sontakke
 
Virus sequence retrieval from NCBI database
yamunaK13
 
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 

Global state recording 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