Browse Source

Fix database migrations and disable the non-standalone job

The pattern of adding a column and then reading a table with it
no longer works in SQLAlchemy 1.3.20. This has been reported
upstream [1] and apparently we're doing the wrong thing by reusing
a column object twice.

We need to disable the non-standalone job since it's really broken
now, and this fix is blocking bifrost.

[1] https://github.com/sqlalchemy/sqlalchemy/issues/5669

Change-Id: I2fb07413e8f421f39b24acf1272771ee2097b195
(cherry picked from commit 5678f219cd)
changes/27/759827/1
Dmitry Tantsur 2 months ago
parent
commit
77a3bd9159
4 changed files with 16 additions and 6 deletions
  1. +2
    -1
      ironic_inspector/migrations/versions/882b2d84cb1b_attribute_constraints_relaxing.py
  2. +8
    -3
      ironic_inspector/migrations/versions/d00d6e3f38c4_change_created_finished_at_type.py
  3. +4
    -0
      releasenotes/notes/migrations-1.3.20-0d337d000bd0a7e0.yaml
  4. +2
    -2
      zuul.d/project.yaml

+ 2
- 1
ironic_inspector/migrations/versions/882b2d84cb1b_attribute_constraints_relaxing.py View File

@@ -63,7 +63,8 @@ def upgrade():
node_uuid_column = sa.Column(NODE_UUID, sa.String(36))
op.add_column(ATTRIBUTES, node_uuid_column)

attributes = sa.table(ATTRIBUTES, node_uuid_column,
attributes = sa.table(ATTRIBUTES,
sa.Column(NODE_UUID, sa.String(36)),
sa.Column(UUID, sa.String(36)))

with op.batch_alter_table(ATTRIBUTES,


+ 8
- 3
ironic_inspector/migrations/versions/d00d6e3f38c4_change_created_finished_at_type.py View File

@@ -32,17 +32,22 @@ depends_on = None


def upgrade():
started_at = sa.Column('started_at', sa.types.Float, nullable=True)
finished_at = sa.Column('finished_at', sa.types.Float, nullable=True)
temp_started_at = sa.Column("temp_started_at", sa.types.DateTime,
nullable=True)
temp_finished_at = sa.Column("temp_finished_at", sa.types.DateTime,
nullable=True)
uuid = sa.Column("uuid", sa.String(36), primary_key=True)

op.add_column("nodes", temp_started_at)
op.add_column("nodes", temp_finished_at)

uuid = sa.Column("uuid", sa.String(36), primary_key=True)
started_at = sa.Column('started_at', sa.types.Float, nullable=True)
finished_at = sa.Column('finished_at', sa.types.Float, nullable=True)
# NOTE(dtantsur): do not reuse the column objects from add_column
temp_started_at = sa.Column("temp_started_at", sa.types.DateTime,
nullable=True)
temp_finished_at = sa.Column("temp_finished_at", sa.types.DateTime,
nullable=True)
t = sa.table('nodes', started_at, finished_at,
temp_started_at, temp_finished_at, uuid)



+ 4
- 0
releasenotes/notes/migrations-1.3.20-0d337d000bd0a7e0.yaml View File

@@ -0,0 +1,4 @@
---
fixes:
- |
Fixes database migrations with SQLAlchemy 1.3.20.

+ 2
- 2
zuul.d/project.yaml View File

@@ -13,7 +13,8 @@
- ironic-inspector-tempest
- ironic-inspector-tempest-discovery
- ironic-inspector-tempest-python3
- ironic-inspector-non-standalone-tempest-python3
- ironic-inspector-non-standalone-tempest-python3:
voting: false
- openstack-tox-functional
- openstack-tox-functional-py36
- bifrost-integration-tinyipa-ubuntu-xenial
@@ -26,7 +27,6 @@
- ironic-inspector-tempest
- ironic-inspector-tempest-discovery
- ironic-inspector-tempest-python3
- ironic-inspector-non-standalone-tempest-python3
- openstack-tox-functional
- openstack-tox-functional-py36
- bifrost-integration-tinyipa-ubuntu-xenial

Loading…
Cancel
Save