Skip to content

the ha first boot still restarts one replica: both race to create schema_migrations #90

Description

@lex00

After the cnpg wait (#86) the first boot at ha is down from two-three restarts per replica to exactly one, on one replica, on a brand-new database: both replicas reach a virgin Postgres together and race to create Ecto's schema_migrations table. The advisory lock serializes migrations only once that table exists, so the loser exits on the unique-constraint error and its retry wins. Benign, and precisely documented in Make it durable — but a clean boot would be better than a well-documented dirty one.

The clean fix is structural: migrations run once, in a Job (or a single elected pod), and the app pods wait for them instead of each running their own. fountain migrates at boot unconditionally, so this needs an upstream switch to skip migrations at app boot — file that against fountain when this is picked up. Until then this issue records why RESTARTS 1 can appear once and never again.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions