Snapshot algorithm

Snapshot algorithm

The snapshot algorithm is an algorithm used in distributed systems for recording a consistent global state of an asynchronous system. It is also known as Chandy-Lamport Algorithm for the determination of consistent global states and obtaining consistent cuts, after Leslie Lamport and K. Mani Chandy.

Contents

History

According to Leslie Lamport's website, “The distributed snapshot algorithm described here came about when I visited Chandy, who was then at the University of Texas in Austin. He posed the problem to me over dinner, but we had both had too much wine to think about it right then. The next morning, in the shower, I came up with the solution. When I arrived at Chandy's office, he was waiting for me with the same solution.”

It was defined in a paper titled “Distributed Snapshots: Determining Global States of a Distributed System.”

Definition

The assumptions of the algorithm are as follows:

  • There are no failures and all messages arrive intact and only once
  • The communication channels are unidirectional and FIFO ordered
  • There is a communication path between any two processes in the system
  • Any process may initiate the snapshot algorithm
  • The snapshot algorithm does not interfere with the normal execution of the processes
  • Each process in the system records its local state and the state of its incoming channels

The algorithm works using marker messages. Each process that wants to initiate a snapshot records its local state and sends a marker on each of its outgoing channels. All the other processes, upon receiving a marker, record their local state, the state of the channel from which the marker just came as empty, and send marker messages on all of their outgoing channels. If a process receives a marker after having recorded its local state, it records the state of the incoming channel from which the marker came as carrying all the messages received since it first recorded its local state.

Some of the assumptions of the algorithm can be facilitated using a more reliable communication protocol such as TCP/IP. The algorithm can be adapted so that there could be multiple snapshots occurring simultaneously.

Working

The snapshot algorithm works like this:

  1. The observer process (the process taking a snapshot):
    1. Saves its own local state
    2. Sends a snapshot request message bearing a snapshot token to all other processes
  2. A process receiving the snapshot token for the first time on any message:
    1. Sends the observer process its own saved state
    2. Attaches the snapshot token to all subsequent messages (to help propagate the snapshot token)
  3. Should a process that has already received the snapshot token receive a message that does not bear the snapshot token, this process will forward that message to the observer process. This message was obviously sent before the snapshot “cut off” (as it does not bear a snapshot token and thus must have come from before the snapshot token was sent out) and needs to be included in the snapshot.

From this, the observer builds up a complete snapshot: a saved state for each process and all messages “in the ether” are saved.

References

Leslie Lamport's Website


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • Snapshot — may refer to:* Snap shot, a shot from a firearm that is aimed and fired quickly * Snapshot (photography), a photograph that is taken in a short moment of opportunity * Snap shot (ice hockey), a shot type in Ice hockey * Snapshot algorithm, a… …   Wikipedia

  • List of algorithms — The following is a list of the algorithms described in Wikipedia. See also the list of data structures, list of algorithm general topics and list of terms relating to algorithms and data structures.If you intend to describe a new algorithm,… …   Wikipedia

  • Software transactional memory — In computer science, software transactional memory (STM) is a concurrency control mechanism analogous to database transactions for controlling access to shared memory in concurrent computing. It is an alternative to lock based synchronization. A… …   Wikipedia

  • Список алгоритмов — Эта страница информационный список. Основная статья: Алгоритм Ниже приводится список алгоритмов, группированный по категориям. Более детальные сведения приводятся в списке структур данных и …   Википедия

  • Leslie Lamport — Infobox Scientist name = Leslie Lamport image width = 150px caption = birth date = February 7, 1941 birth place = New York City, New York death date = death place = residence = citizenship = nationality = ethnicity = field = Computer Science work …   Wikipedia

  • K. Mani Chandy — Kanianthra Mani Chandy Institutions Caltech Alma mater Indian Institute of Technology (B.Tech., 1965) Polytechnic Institute of Brooklyn (M.S., 1966) MIT (Ph.D …   Wikipedia

  • Программная транзакционная память — Для улучшения этой статьи желательно?: Проверить качество перевода с иностранного языка. В компьютерных технологиях, программная транзакционная память ( …   Википедия

  • Commitment ordering — In concurrency control of databases, transaction processing (transaction management), and related applications, Commitment ordering (or Commit ordering; CO; (Raz 1990, 1992, 1994, 2009)) is a class of interoperable Serializability techniques …   Wikipedia

  • Serializability — In concurrency control of databases,[1][2] transaction processing (transaction management), and various transactional applications (e.g., transactional memory[3] and software transactional memory), both centralized and distributed, a transaction… …   Wikipedia

  • Microsoft SQL Server — Developer(s) Microsoft Stable release SQL Server 2008 R2 (10.50.2500.0 Service Pack 1) / July 11, 2011; 4 months ago …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”