Skip to content

startup: gRPC socket only appears after full recovery — restarts on nodes with accumulated state go dark for minutes #791

Description

@iaroslav-reflection

On restart, NewSnapshotter completes all recovery work before Serve() creates the unix socket: per-daemon GetState, restarting dead daemons (including remounting their RAFS instances), the hot-upgrade check, and the initial credential reconciliation (#790 moves that one off the startup path). Recovery time scales with the daemons/mounts/snapshots accumulated on the node, and nothing prunes those, so on a long-lived node a restart can leave the socket missing for minutes — containerd gets Unavailable for every snapshot RPC and all new container creation on the node fails until recovery finishes. systemd reports the unit active the whole time (Type=simple), so nothing signals the window. A crash during recovery re-enters it every RestartSec.

Two design questions before proposing anything concrete:

  1. Is serve-after-full-recovery an invariant you want to keep (correctness of snapshot ops against half-recovered state), or would you consider serving earlier and recovering daemons in the background?
  2. If the ordering must stay: would you take (a) an opt-in readiness signal (sd_notify + Type=notify) so operators can gate on and observe the recovery window, and/or (b) parallelizing the per-daemon recovery walk so the window is bounded by the slowest daemon instead of the sum?

Happy to send PRs for whichever direction you prefer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions