noCV
ALEASE-104 · Guard competing owners

Acquire a scheduler lease atomically under competing instances

Practice briefStoryAdvanced

Two instances see an expired lease and both believe they became the active scheduler.

Focused work estimate
3h 30m + prerequisites
Priority in the scenario
High
Engineering practice
Transactions · Leader coordination

Estimated field mix

  • Distributed systems60%
  • Database engineering40%

Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.

Your next step

Review it, then add it to your workspace.

The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.

Project context

A fictional document service runs periodic retention planning on multiple application instances. Paused instances resume after lease expiry and can overlap newer schedulers.

Setup prerequisites

  • Create a synthetic maintenance queue and two independent scheduler clients.
  • Use fake time where possible and no destructive real retention actions.

Preceding work

Complete these dependencies, or supply their agreed outputs before taking this ticket.

Acceptance criteria

  • Acquire through one guarded database transaction.
  • Increment the epoch only for the winning acquisition.
  • Return current safe ownership metadata to the loser.

Implementation constraints

  • Use two independent database connections and a barrier.

Verification to include

  • Race two acquisitions and assert one winning epoch.
  • Hold a valid lease and verify another instance cannot replace it early.

Deliverables

  • Atomic acquisition command and race test

Rollout and recovery

Canary with two local clients; stop scheduling if ownership results conflict.

Value of the work

For the engineer: Practice lease assumptions, fencing and stale-owner rejection.

For the team: Review safe coordination that remains explainable under pauses and recovery.

Evidence boundaries

Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.

Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.