Vector clock

Last updated

A vector clock is a data structure used for determining the partial ordering of events in a distributed system and detecting causality violations. Just as in Lamport timestamps, inter-process messages contain the state of the sending process's logical clock. A vector clock of a system of N processes is an array/vector of N logical clocks, one clock per process; a local "largest possible values" copy of the global clock-array is kept in each process.

Contents

Denote as the vector clock maintained by process , the clock updates proceed as follows: [1]

Example of a system of vector clocks. Events in the blue region are the causes leading to event B4, whereas those in the red region are the effects of event B4. Vector Clock.svg
Example of a system of vector clocks. Events in the blue region are the causes leading to event B4, whereas those in the red region are the effects of event B4.

History

Lamport originated the idea of logical Lamport clocks in 1978. [2] However, the logical clocks in that paper were scalars, not vectors. The generalization to vector time was developed several times, apparently independently, by different authors in the early 1980's. [3] At least 6 papers contain the concept. [4] The papers canonically cited in reference to vector clocks are Colin Fidge’s and Friedemann Mattern’s 1988 works, [5] [6] as they (independently) established the name "vector clock" and the mathematical properties of vector clocks. [3]

Partial ordering property

Vector clocks allow for the partial causal ordering of events. Defining the following:

Properties:

Relation with other orders:

Other mechanisms

See also

Related Research Articles

<span class="mw-page-title-main">Associative property</span> Property of a mathematical operation

In mathematics, the associative property is a property of some binary operations, which means that rearranging the parentheses in an expression will not change the result. In propositional logic, associativity is a valid rule of replacement for expressions in logical proofs.

<span class="mw-page-title-main">Leslie Lamport</span> American computer scientist and mathematician

Leslie B. Lamport is an American computer scientist and mathematician. Lamport is best known for his seminal work in distributed systems, and as the initial developer of the document preparation system LaTeX and the author of its first manual.

In computer science, the happened-before relation is a relation between the result of two events, such that if one event should happen before another event, the result must reflect that, even if those events are in reality executed out of order. This involves ordering events based on the potential causal relationship of pairs of events in a concurrent system, especially asynchronous distributed systems. It was formulated by Leslie Lamport.

Basic Linear Algebra Subprograms (BLAS) is a specification that prescribes a set of low-level routines for performing common linear algebra operations such as vector addition, scalar multiplication, dot products, linear combinations, and matrix multiplication. They are the de facto standard low-level routines for linear algebra libraries; the routines have bindings for both C and Fortran. Although the BLAS specification is general, BLAS implementations are often optimized for speed on a particular machine, so using them can bring substantial performance benefits. BLAS implementations will take advantage of special floating point hardware such as vector registers or SIMD instructions.

Clock synchronization is a topic in computer science and engineering that aims to coordinate otherwise independent clocks. Even when initially set accurately, real clocks will differ after some amount of time due to clock drift, caused by clocks counting time at slightly different rates. There are several problems that occur as a result of clock rate differences and several solutions, some being more acceptable than others in certain contexts.

A logical clock is a mechanism for capturing chronological and causal relationships in a distributed system. Often, distributed systems may have no physically synchronous global clock. In many applications, if two processes never interact, the lack of synchronization is unobservable and in these applications it is enough for the processes to agree on the event ordering rather than the wall-clock time. The first logical clock implementation, the Lamport timestamps, was proposed by Leslie Lamport in 1978.

Eventual consistency is a consistency model used in distributed computing to achieve high availability that informally guarantees that, if no new updates are made to a given data item, eventually all accesses to that item will return the last updated value. Eventual consistency, also called optimistic replication, is widely deployed in distributed systems and has origins in early mobile computing projects. A system that has achieved eventual consistency is often said to have converged, or achieved replica convergence. Eventual consistency is a weak guarantee – most stronger models, like linearizability, are trivially eventually consistent.

The Lamport timestamp algorithm is a simple logical clock algorithm used to determine the order of events in a distributed computer system. As different nodes or processes will typically not be perfectly synchronized, this algorithm is used to provide a partial ordering of events with minimal overhead, and conceptually provide a starting point for the more advanced vector clock method. The algorithm is named after its creator, Leslie Lamport.

The Ricart–Agrawala algorithm is an algorithm for mutual exclusion on a distributed system. This algorithm is an extension and optimization of Lamport's Distributed Mutual Exclusion Algorithm, by removing the need for messages. It was developed by Glenn Ricart and Ashok Agrawala.

Causal consistency is one of the major memory consistency models. In concurrent programming, where concurrent processes are accessing a shared memory, a consistency model restricts which accesses are legal. This is useful for defining correct data structures in distributed shared memory or distributed transactions.

A fundamental problem in distributed computing and multi-agent systems is to achieve overall system reliability in the presence of a number of faulty processes. This often requires coordinating processes to reach consensus, or agree on some data value that is needed during computation. Example applications of consensus include agreeing on what transactions to commit to a database in which order, state machine replication, and atomic broadcasts. Real-world applications often requiring consensus include cloud computing, clock synchronization, PageRank, opinion formation, smart power grids, state estimation, control of UAVs, load balancing, blockchain, and others.

Paxos is a family of protocols for solving consensus in a network of unreliable or fallible processors. Consensus is the process of agreeing on one result among a group of participants. This problem becomes difficult when the participants or their communications may experience failures.

Limited-memory BFGS is an optimization algorithm in the family of quasi-Newton methods that approximates the Broyden–Fletcher–Goldfarb–Shanno algorithm (BFGS) using a limited amount of computer memory. It is a popular algorithm for parameter estimation in machine learning. The algorithm's target problem is to minimize over unconstrained values of the real-vector where is a differentiable scalar function.

In graph theory and computer science, the lowest common ancestor (LCA) of two nodes v and w in a tree or directed acyclic graph (DAG) T is the lowest node that has both v and w as descendants, where we define each node to be a descendant of itself.

Operational transformation (OT) is a technology for supporting a range of collaboration functionalities in advanced collaborative software systems. OT was originally invented for consistency maintenance and concurrency control in collaborative editing of plain text documents. Its capabilities have been extended and its applications expanded to include group undo, locking, conflict resolution, operation notification and compression, group-awareness, HTML/XML and tree-structured document editing, collaborative office productivity tools, application-sharing, and collaborative computer-aided media design tools. In 2009 OT was adopted as a core technique behind the collaboration features in Apache Wave and Google Docs.

In computer science, locality-sensitive hashing (LSH) is an algorithmic technique that hashes similar input items into the same "buckets" with high probability. Since similar items end up in the same buckets, this technique can be used for data clustering and nearest neighbor search. It differs from conventional hashing techniques in that hash collisions are maximized, not minimized. Alternatively, the technique can be seen as a way to reduce the dimensionality of high-dimensional data; high-dimensional input items can be reduced to low-dimensional versions while preserving relative distances between items.

In computer science, lattice problems are a class of optimization problems related to mathematical objects called lattices. The conjectured intractability of such problems is central to the construction of secure lattice-based cryptosystems: Lattice problems are an example of NP-hard problems which have been shown to be average-case hard, providing a test case for the security of cryptographic algorithms. In addition, some lattice problems which are worst-case hard can be used as a basis for extremely secure cryptographic schemes. The use of worst-case hardness in such schemes makes them among the very few schemes that are very likely secure even against quantum computers. For applications in such cryptosystems, lattices over vector space or free modules are generally considered.

In computer science, streaming algorithms are algorithms for processing data streams in which the input is presented as a sequence of items and can be examined in only a few passes, typically just one. These algorithms are designed to operate with limited memory, generally logarithmic in the size of the stream and/or in the maximum value in the stream, and may also have limited processing time per item.

The Brooks–Iyengar algorithm or FuseCPA Algorithm or Brooks–Iyengar hybrid algorithm is a distributed algorithm that improves both the precision and accuracy of the interval measurements taken by a distributed sensor network, even in the presence of faulty sensors. The sensor network does this by exchanging the measured value and accuracy value at every node with every other node, and computes the accuracy range and a measured value for the whole network from all of the values collected. Even if some of the data from some of the sensors is faulty, the sensor network will not malfunction. The algorithm is fault-tolerant and distributed. It could also be used as a sensor fusion method. The precision and accuracy bound of this algorithm have been proved in 2016.

Michel Raynal is a French informatics scientist, professor at IRISA, University of Rennes, France. He is known for his contributions in the fields of algorithms, computability, and fault-tolerance in the context of concurrent and distributed systems. Michel Raynal is also Distinguished Chair professor at the Hong Kong Polytechnic University and editor of the “Synthesis Lectures on Distributed Computing Theory” published by Morgan & Claypool. He is a senior member of Institut Universitaire de France and a member of Academia Europaea.

References

  1. "Distributed Systems 3rd edition (2017)". DISTRIBUTED-SYSTEMS.NET. Retrieved 2021-03-21.
  2. Lamport, L. (1978). "Time, clocks, and the ordering of events in a distributed system" (PDF). Communications of the ACM . 21 (7): 558–565. doi:10.1145/359545.359563. S2CID   215822405.
  3. 1 2 Schwarz, Reinhard; Mattern, Friedemann (March 1994). "Detecting causal relationships in distributed computations: In search of the holy grail". Distributed Computing. 7 (3): 149–174. doi:10.1007/BF02277859. S2CID   3065996.
  4. Kuper, Lindsey (8 April 2023). "Who invented vector clocks?". decomposition ∘ al. The papers are (in chronological order):
    • Fischer, Michael J.; Michael, Alan (1982). "Sacrificing serializability to attain high availability of data in an unreliable network". Proceedings of the 1st ACM SIGACT-SIGMOD symposium on Principles of database systems - PODS '82. p. 70. doi:10.1145/588111.588124. ISBN   0897910702. S2CID   8774876.
    • Parker, D.S.; Popek, G.J.; Rudisin, G.; Stoughton, A.; Walker, B.J.; Walton, E.; Chow, J.M.; Edwards, D.; Kiser, S.; Kline, C. (May 1983). "Detection of Mutual Inconsistency in Distributed Systems". IEEE Transactions on Software Engineering. SE-9 (3): 240–247. doi:10.1109/TSE.1983.236733. S2CID   2483222.
    • Wuu, Gene T.J.; Bernstein, Arthur J. (1984). "Efficient solutions to the replicated log and dictionary problems". Proceedings of the third annual ACM symposium on Principles of distributed computing - PODC '84. pp. 233–242. doi:10.1145/800222.806750. ISBN   0897911431. S2CID   2384672.
    • Strom, Rob; Yemini, Shaula (August 1985). "Optimistic recovery in distributed systems". ACM Transactions on Computer Systems. 3 (3): 204–226. doi:10.1145/3959.3962. S2CID   1941122.
    • Schmuck, Frank B. (November 1985). Software clocks and the order of events in a distributed system (unpublished).
    • Liskov, Barbara; Ladin, Rivka (1986). "Highly available distributed services and fault-tolerant distributed garbage collection". Proceedings of the fifth annual ACM symposium on Principles of distributed computing - PODC '86. pp. 29–39. doi:10.1145/10590.10593. ISBN   0897911989. S2CID   16148617.
    • Raynal, Michel (February 1987). "A distributed algorithm to prevent mutual drift between n logical clocks". Information Processing Letters. 24 (3): 199–202. doi:10.1016/0020-0190(87)90186-4.
  5. Fidge, Colin J. (February 1988). "Timestamps in message-passing systems that preserve the partial ordering" (PDF). In K. Raymond (ed.). Proceedings of the 11th Australian Computer Science Conference (ACSC'88). Vol. 10. pp. 56–66. Retrieved 2009-02-13.
  6. Mattern, Friedemann (October 1988). "Virtual Time and Global States of Distributed systems". In Cosnard, M. (ed.). Proc. Workshop on Parallel and Distributed Algorithms. Chateau de Bonas, France: Elsevier. pp. 215–226.
  7. Francisco Torres-Rojas; Mustaque Ahamad (1999), "Plausible clocks: constant size logical clocks for distributed systems", Distributed Computing, 12 (4): 179–195, doi:10.1007/s004460050065, S2CID   2936350
  8. Agarwal, Anurag; Garg, Vijay K. (17 July 2005). "Efficient dependency tracking for relevant events in shared-memory systems" (PDF). Proceedings of the twenty-fourth annual ACM symposium on Principles of distributed computing. Association for Computing Machinery. pp. 19–28. doi:10.1145/1073814.1073818. ISBN   1-58113-994-2. S2CID   11779779 . Retrieved 21 April 2021.
  9. Almeida, Paulo; Baquero, Carlos; Fonte, Victor (2008), "Interval Tree Clocks: A Logical Clock for Dynamic Systems", in Baker, Theodore P.; Bui, Alain; Tixeuil, Sébastien (eds.), Principles of Distributed Systems (PDF), Lecture Notes in Computer Science, vol. 5401, Springer-Verlag, Lecture Notes in Computer Science, pp. 259–274, Bibcode:2008LNCS.5401.....B, doi:10.1007/978-3-540-92221-6, ISBN   978-3-540-92220-9
  10. Almeida, Paulo; Baquero, Carlos; Fonte, Victor (2008), "Interval Tree Clocks: A Logical Clock for Dynamic Systems", Interval Tree Clocks: A Logical Clock for Dynamic Systems, Lecture Notes in Computer Science, vol. 5401, p. 259, doi:10.1007/978-3-540-92221-6_18, hdl: 1822/37748 , ISBN   978-3-540-92220-9
  11. Zhang, Yi (2014), "Background Preliminaries: Interval Tree Clock Results", Background Preliminaries: Interval Tree Clock Results (PDF)
  12. Pozzetti, Tommaso; Kshemkalyani, Ajay D. (1 April 2021). "Resettable Encoded Vector Clock for Causality Analysis With an Application to Dynamic Race Detection". IEEE Transactions on Parallel and Distributed Systems. 32 (4): 772–785. doi:10.1109/TPDS.2020.3032293. S2CID   220362525.
  13. Lum Ramabaja (2019), The Bloom Clock, arXiv: 1905.13064 , Bibcode:2019arXiv190513064R
  14. Kulkarni, Sandeep S; Appleton, Gabe; Nguyen, Duong (4 January 2022). "Achieving Causality with Physical Clocks". Proceedings of the 23rd International Conference on Distributed Computing and Networking. pp. 97–106. arXiv: 2104.15099 . doi:10.1145/3491003.3491009. ISBN   9781450395601. S2CID   233476293.