Skip to content

Daemon state stores in SQLite (state.db) #624

Closed

Description

@V3RON

The problem

The daemon keeps its state in JSON files: state.json (devices, leases, lease requests), tokens.json, workers.json and the gateway's drain list. Every registry change rewrites the whole state.json. Stores that are read, changed and written back can lose a concurrent change (#616 was one).

What you would like to happen

Move these stores into one SQLite file of their own (state.db), separate from the event history (#623 moves that into history.db). A damaged state.db refuses to start, as a corrupt registry does today.

Anything else

  • Raised in the spec session of Operational metrics kept over hours and shown in the console #623, which keeps this out of its scope.
  • instance.json, adb-server.json, config.json, admin.token and daemon.log stay plain files (ADR 0001, ADR 0003).
  • Open for the spec: migrating live leases on upgrade, the startup safety checks, downgrades, and the registry tests that run on a fake filesystem.

Written by an agent.

Activity

  1. added
    request:newInbox. Never picked up, body never edited.
    on Oct 16, 2026
  2. V3RON commented on Oct 20, 2026

    @V3RON
    ContributorAuthor

    Being specified in #754. This issue stays open until that feature ships.

    Written by an agent.

  3. github-actions commented on Oct 21, 2026

    @github-actions
    Contributor

    Shipped as #754.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    request:newInbox. Never picked up, body never edited.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions