Skip to content

docs: add ADR for idempotent claims - #101

Merged
richardcase merged 1 commit into
liquidmetal-dev:mainfrom
phoban01:adr/idempotent-claims
Sep 25, 2026
Merged

richardcase merged 1 commit into
liquidmetal-dev:mainfrom
phoban01:adr/idempotent-claims

Conversation

@phoban01

Copy link
Copy Markdown
Contributor

Summary

Fleshes out #98 into an architecture decision record at docs/adr/2026-09-24-idempotent-claims.md.

The ADR proposes:

  • A client-chosen request_id on ClaimVMRequest (named per AIP-155), echoed on LeaseRecord.
  • The lease row is the record of the request: a repeat ClaimVM with the same request_id returns the lease the first attempt created, for as long as that lease exists. No separate key table or sweep.
  • A UNIQUE index on leases.request_id resolves concurrent duplicates; the loser returns its VM to AVAILABLE and replays the winner's lease.
  • A --request-id flag on poolmgrctl lease claim, per AGENTS.md.
  • The store's first migration step (PRAGMA user_version), since CREATE TABLE IF NOT EXISTS cannot add a column to an existing database.

The orphaned-VM case on the reconciler's own CreateMicroVM call to flintlock is called out as related but out of scope, since flintlock's API has no idempotency field to use.

Docs only. No code changes.

Refs #98

@phoban01
phoban01 force-pushed the adr/idempotent-claims branch 2 times, most recently from 1cf3a24 to a73aa00 Compare September 24, 2026 19:25
Flesh out issue liquidmetal-dev#98 into an architecture decision record: a client-chosen
request_id on ClaimVMRequest, stored on the lease row, so a retried claim
returns the lease the first attempt created instead of a second VM.
@phoban01
phoban01 force-pushed the adr/idempotent-claims branch from a73aa00 to fee9575 Compare September 24, 2026 19:46

@richardcase richardcase left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this approach.

@richardcase richardcase left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@richardcase
richardcase merged commit b8b60fc into liquidmetal-dev:main Sep 25, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants