Remove db_api.setup_db() from manager startup
To avoid racing with alembic migrations, remove behavior where manager would create missing tables on startup. Closes-Bug: #2161471 Change-Id: Ic9c6a2e60dab48f6b9435a0170c079d2d5978365 Signed-off-by: Michael Sherman <shermanm@uchicago.edu>
This commit is contained in:
1 parent
acc44dc979
commit
a9523907f1
3 files changed
+21
-2
No files matched your search
@@ -24,7 +24,6 @@ from oslo_service import service
|
||||
|
||||
gettext.install('blazar')
|
||||
|
||||
from blazar.db import api as db_api
|
||||
from blazar.manager import service as manager_service
|
||||
from blazar.notification import notifier
|
||||
from blazar.utils import service as service_utils
|
||||
@@ -33,7 +32,6 @@ from blazar.utils import service as service_utils
|
||||
def main():
|
||||
cfg.CONF(project='blazar', prog='blazar-manager')
|
||||
service_utils.prepare_service(sys.argv)
|
||||
db_api.setup_db()
|
||||
notifier.init()
|
||||
service.launch(
|
||||
cfg.CONF,
|
||||
|
||||
@@ -134,6 +134,14 @@ Then edit the database section of */etc/blazar/blazar.conf*:
|
||||
|
||||
..
|
||||
|
||||
Then create the Blazar database schema by running the migrations:
|
||||
|
||||
.. sourcecode:: console
|
||||
|
||||
blazar-db-manage --config-file /etc/blazar/blazar.conf upgrade head
|
||||
|
||||
..
|
||||
|
||||
To start Blazar services use:
|
||||
|
||||
.. sourcecode:: console
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
upgrade:
|
||||
- |
|
||||
``blazar-manager`` no longer creates database tables at startup. The
|
||||
database schema is now managed exclusively by Alembic migrations.
|
||||
Operators must run ``blazar-db-manage --config-file <conf> upgrade head``
|
||||
before starting ``blazar-manager`` on a new deployment (as is already done
|
||||
for DevStack-based installs). Existing deployments are unaffected.
|
||||
fixes:
|
||||
- |
|
||||
Removed the implicit ``db_api.setup_db()`` call from ``blazar-manager``,
|
||||
which could race with Alembic migrations during deploys or restarts and
|
||||
leave the database in an inconsistent state.
|
||||
Reference in new issue
Block a user