Graylog2 / graylog2-server

Free and open log management
https://www.graylog.org
Other
7.44k stars 1.07k forks source link

Run database migrations before services start #6671

Open bernd opened 5 years ago

bernd commented 5 years ago

Our database migrations are currently executed by the Periodicals sub-system. That means they execute at some point after the periodicals system has started. This is an issue because some services might start before the migrations have been executed and run into problems.

Examples:

To fix this, the database migrations should be executed before other services start.

Ideally we should also move the index creation out of the database services into a migration or a separate step during the bootstrap process. Right now the database indices are created on every instance creation of the database services.

2020-01-10 update: This becomes even more involved in a cluster of Graylog servers. Other servers should not start their services until the migrations are done. That means we need some kind of cluster state so all nodes wait until migrations are done and the cluster is "ready".

Refs https://github.com/Graylog2/graylog2-server/issues/5248

Tasks

mpfz0r commented 2 years ago

Partly done with #11526