Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add schema version check to db health check. #893

Merged
merged 2 commits into from
Jun 23, 2016
Merged

Conversation

ejholmes
Copy link
Contributor

Closes #891

This adds a check to the db health check that checks that the schema version matches what the running version of Empire expects. This means:

  1. If you're in the process of upgrading to a new version of Empire, once the migrations are complete, older versions of Empire will start failing health checks and get taken out of the load balancer (assuming you have Empire behind a load balancer and are using the /health endpoint).

  2. If you try to start empire server with an incompatible database schema, you'll get an error message:

    $ ./build/empire server
    2016/06/23 12:19:23 Streaming logs are disabled
    2016/06/23 12:19:23 Using Stdout run logs backend:
    2016/06/23 12:19:23 expected database schema to be at version 17, but was 18. You can resolve this error by running the migrations with `empire migrate` or with the `--automigrate` flag

@phobologic
Copy link
Contributor

awesome 👍

@mwildehahn
Copy link
Contributor

👍

@ejholmes ejholmes merged commit b29ece6 into master Jun 23, 2016
@ejholmes ejholmes deleted the schema-health branch June 23, 2016 23:54
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.

Fail to boot if DB schema is incompatible
3 participants