Migration tests fail with sqlalchemy 0.8

Bug #1206561 reported by Chuck Short on 2013-07-30
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Roman Podoliaka

Bug Description

Migration tests fail with sqlalchemy 0.8:

FAIL: cinder.tests.db.test_finish_migration.FinishVolumeMigrationTestCase.test_finish_volume_migration
tags: worker-0
Empty attachments:

pythonlogging:'': {{{
DB exception wrapped.
Traceback (most recent call last):
  File "/��BUILDDIR��/cinder-2013.2+git201307290601~saucy/cinder/openstack/common/db/sqlalchemy/session.py", line 467, in _wrap
    return f(*args, **kwargs)
  File "/��BUILDDIR��/cinder-2013.2+git201307290601~saucy/cinder/openstack/common/db/sqlalchemy/session.py", line 646, in execute
    return super(Session, self).execute(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 934, in execute
    clause, params or {})
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 662, in execute
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 754, in _execute_clauseelement
    inline=len(distilled_params) > 1)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/expression.py", line 1912, in compile
    return self._compiler(dialect, bind=bind, **kw)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/expression.py", line 1918, in _compiler
    return dialect.statement_compiler(dialect, self, **kw)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/compiler.py", line 289, in __init__
    engine.Compiled.__init__(self, dialect, statement, **kwargs)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/interfaces.py", line 787, in __init__
    self.string = self.process(self.statement, **compile_kwargs)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/interfaces.py", line 806, in process
    return obj._compiler_dispatch(self, **kwargs)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/visitors.py", line 74, in _compiler_dispatch
    return getter(visitor)(self, **kw)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/compiler.py", line 1473, in visit_update
    colparams = self._get_colparams(update_stmt, extra_froms)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/compiler.py", line 1767, in _get_colparams
    (", ".join(check))
CompileError: Unconsumed column names: volume_metadata, volume_type

Changed in cinder:
assignee: nobody → Roman Podolyaka (rpodolyaka)

Fix proposed to branch: master
Review: https://review.openstack.org/47984

Changed in cinder:
status: New → In Progress

Reviewed: https://review.openstack.org/47984
Committed: http://github.com/openstack/cinder/commit/36fab5ae26579c3cc68ef4ca02bdab3c232ce648
Submitter: Jenkins
Branch: master

commit 36fab5ae26579c3cc68ef4ca02bdab3c232ce648
Author: Roman Podolyaka <email address hidden>
Date: Mon Sep 23 17:58:54 2013 +0300

    Fix finish_volume_migration() on SQLAlchemy 0.8.x

    In SQAlchemy 0.8.x "Unconsumed column names" warning became
    an exception, so refering to a non-existent column in insert()
    or update() call raises an error.

    finish_volume_migration() calls Session.update() method passing
    values of two non-existent columns as arguments (volume_metadata,
    volume_admin_metadata, volume_type). These two are not table columns
    at all, but rather SQLAlchemy models relationships.

    As SQLAlchemy ORM implements Unity of Work pattern, we should not
    really track changes to a model instance manually at all, because
    Session class already does it for us. finish_volume_migration()
    is refactored to take benefit of this fact.

    Fixes bug 1206561

    Change-Id: I4513e3155a7dc6dcbd1c95aa9c14d1e1e5d02ab4

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2013-10-04
Changed in cinder:
milestone: none → havana-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2013-10-17
Changed in cinder:
milestone: havana-rc1 → 2013.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers