All Questions
Dealing With Contention hard

In a distributed lock (e.g., Redlock), Clinet A acquires the lock but pauses for a long GC. The lock expires. Client B acquires it. Client A wakes up and writes to storage, corrupting B's work. How do 'Fencing Tokens' solve this?

  1. A They force the GC to stop.
  2. B They encrypt the lock.
  3. C They use GPS time.
  4. D The lock service issues a monotonically increasing token (1, 2, 3...) with each lock. The storage layer rejects any write with a token older than the highest token it has seen (Reject write 33 if 34 has been seen).

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions