Search DistillSys

Find a concept

Type at least two characters to search lessons, designs, papers, and interview prep.

Coordination incident · Staff+

A clock jump creates two lease holders

Time-based ownership outlives its safety assumptions after virtualization pauses and clock correction.

01
Establish the operating contract

Incident brief

Business impact

Two workers concurrently execute a daily settlement job, producing conflicting ledger exports.

Current architecture

Workers acquire a database lease with an expiry timestamp based on local wall clocks. The resource accepts writes from any worker presenting the lease ID.

Protected invariant

At most one settlement worker may mutate a settlement generation.

Constraints
  • The job may pause, but overlapping mutations are unacceptable.
  • Workers and the database are in different failure domains.
  • Some settlement steps call external systems.
02
Build a causal model

Evidence timeline

  1. Worker A renews its lease through 02:00:28, then pauses for 38 seconds during host migration.

  2. Worker B observes the lease expired and acquires a new lease.

  3. Worker A resumes with its old lease and continues writing.

  4. NTP steps A's wall clock backward by 420 ms; both workers report valid ownership.

03
Reason before revealing

Your response

1Diagnose

Why can neither worker's local clock prove exclusive ownership?

Need a nudge?

A paused process cannot observe that its authority expired elsewhere.

2Stabilize

How do you stop stale workers from mutating state?

Need a nudge?

The protected resource must participate in rejecting old authority.

3Recover

How do you repair work when external steps may already have run twice?

Need a nudge?

Fence internal writes and reconcile external operations by stable generation IDs.

4Prevent

What lease protocol and test cases make the timing assumptions explicit?

Need a nudge?

Use monotonically increasing authority, bounded time assumptions, and pause testing.

04
Compare reasoning, not wording

Model response

Reveal structured response
Diagnosis

Lease expiry is observed independently, while the old holder can pause past expiry and resume. Wall-clock correction worsens reasoning, but the fundamental issue is that the resource accepts stale authority.

Stabilize now
  1. Pause settlement dispatch and fence both workers at the mutation store.
  2. Issue a new monotonically increasing fencing token to one elected worker.
  3. Require every protected write to carry the token and reject values below the highest seen.
  4. Record the affected settlement generation for reconciliation.
Recover safely
  1. Compare writes by fencing token/generation and rebuild a canonical settlement output.
  2. Reconcile external calls using stable settlement and operation IDs; compensate duplicates by provider state.
  3. Do not simply delete one worker's records when downstream effects may exist.
  4. Resume from a checkpoint under a new fenced generation.
Prevent recurrence
  1. Use a consensus-backed lease/lock service that returns monotonically increasing fencing tokens.
  2. Use monotonic time for durations while treating wall-clock time as presentation data.
  3. Make the storage and external-operation gateways validate generation authority where possible.
  4. Inject long pauses, delayed renewals, partitions, and clock steps in tests.
05
Use evidence-based self-assessment

10-point rubric

Your score0 / 10

Check only the signals your answer demonstrated.

Common traps
  • Only increasing the lease duration
  • Trusting synchronized wall clocks as a lock
  • Checking the lease once at job start
  • Assuming killing the old process reverses its external effects
06
Strengthen the underlying concepts

Related refreshers