Questions tagged [vector-clock]

Vector clock is an algorithm for partial event ordering in distributed Systems

Vector clock is an algorithm for partial event ordering in distributed Systems. It can be used to detect and to resolve concurrent writes to different nodes in the distributed system

20 questions
8
votes
4 answers

Is there an off-the-shelf clock synchronization solution for Java?

We have a large high-performance software system which consists of multiple interacting Java processes (not EJBs). Each process can be on the same machine or on a different machine. Certain events are generated in one process, and are then…
Uri
  • 88,451
  • 51
  • 221
  • 321
8
votes
2 answers

Implementation of Vector Clocks

For my code which is running on different devices, i need to determine the ordering of messages which are sent between those devices. Therefore I would like to use vector clocks since I read vector clocks allow for the ordering of events. Is there…
anon
8
votes
2 answers

What do matrix clocks solve but vector clocks can't?

I understand the need for vector clocks in terms of scalar logical clocks failing to provide enough information to tell whether there is an update conflict in a key value store update for example. But I am not sure what problem is still unsolved by…
Lazer
  • 90,700
  • 113
  • 281
  • 364
5
votes
2 answers

Is the MongooseJS "versionKey" (__v field) a "vector clock"?

I've been using MongooseJS's revisionKey for a while now - the __v field that it includes with documents, by default. I understand what the purpose of the revision number is, and generally when it is updated. I was recently speaking with a friend…
Derick Bailey
  • 72,004
  • 22
  • 206
  • 219
4
votes
1 answer

How does the messenger maintain the sequencing of the messages during chat and when users log in again?

I was asked this question in an interview and was unable to answer it. How does FB messenger order the messages on user side when two messages are concurrent in order to avoid view difference in display order during the chat period and when user…
4
votes
1 answer

Comparison of Vector clocks for event correlation

I have a bunch of log files consisting of event logs along with their vector clocks logged in them. Now while comparing the vector clocks of any two events, would it be correct to take the root of the sum of the squares of each component of the…
HungryTux
  • 355
  • 3
  • 14
3
votes
0 answers

Dynamic vector clock reconstruction with multiple nodes

I am using a dynamic vector clock for my application with multiple nodes. Each node has a unique ID which is stored alongside its clock in the vector clock. I need to turn the vector clock into a textual representation. My current solution is to…
3
votes
2 answers

Atomic, scalable, monotonic counter with boundary

I have a critical code path where threads use an atomic increment on an integer to count the number of events that have happened globally. This is reasonably fast, but still requires that the cache line holding the integer bounces between cores. In…
Thomas Kejser
  • 1,264
  • 1
  • 10
  • 30
2
votes
2 answers

How to generate unique timestamps in PostgreSQL?

My idea is to implement a basic «vector clock», where a timestamps are clock-based, always go forward and are guaranteed to be unique. For example, in a simple table: CREATE TABLE IF NOT EXISTS timestamps ( last_modified TIMESTAMP UNIQUE ); I…
leplatrem
  • 1,005
  • 13
  • 25
2
votes
2 answers

G-Counters in Riak: Don't the underlying vclocks provide the same data?

I've been reading into CvRDTs and I'm aware that Riak has already added a few to Riak 2. My question is: why would Riak implement a gcounter when it sounds like the underlying vclock that is associated with every object records the same information?…
Lawrence Wagerfield
  • 6,471
  • 5
  • 42
  • 84
1
vote
1 answer

Logical Time, Lamport Timestamps and Vector Clocks in distributed systems

I am currently studying Distributed Systems for an exam. I think I have understood all the principles so far, but I go crazy when it comes to the topics of logical time, lamport timestamps and vector clocks. I just can't get an overview and…
1
vote
0 answers

Sorting list of vector clocks (total order)?

I understand that vector clocks only provide a partial order. So you can't directly sort them. For this reason you use a tie-breaker for vectors that are concurrent, resulting in a total order. However sorting the vector clocks so that every cause…
Benjoyo
  • 413
  • 7
  • 13
1
vote
1 answer

How to determine Last write win on concurrent Vector clocks?

I'd like to keep track of only the recent data and also employ the help of Vector clocks in resolving issues so I can easily discard data via L-W-W rule.(last write wins) Say we have 3 nodes: - Node1 - Node2 - Node3 Then we would use Vector clocks…
1
vote
1 answer

Vector Clock different implementations

It is very well-known that Vector clocks detect causal dependencies between events, but there are different implementation methods. What are the differences (advantages/disadvantages) between: ticking only when sending (before). ticking only when…
Ben
  • 69
  • 8
0
votes
2 answers

What if vector clock update reaches much before the actual update?

In a normal Vector clock algorithm, the vector clock is piggybacked along with the request itself. What if the vector clock gets updated much before the actual request comes ? As in the vector clock and requests are updated independently and the…
1
2