yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #56228
[Bug 1621490] Re: Migration to Newton fails in 97c25b0d2353_add_name_desc
Reviewed: https://review.openstack.org/367690
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=7f1caa1310872bbbc35a3277c9db82a3376ef3ca
Submitter: Jenkins
Branch: master
commit 7f1caa1310872bbbc35a3277c9db82a3376ef3ca
Author: Henry Gessau <HenryG@xxxxxxxxxx>
Date: Thu Sep 8 19:02:37 2016 -0400
Add missing index on inserted_primary_key in migration
MySQL doesn't seem to care, but Postgres and MariaDB barf on it.
Also add a test with data for this migration.
Change-Id: Ie464a65b291e5974a23e9b45de1654709092b4ad
Closes-Bug: #1621490
** Changed in: neutron
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1621490
Title:
Migration to Newton fails in 97c25b0d2353_add_name_desc
Status in neutron:
Fix Released
Bug description:
The 97c25b0d2353_add_name_desc.py DB migration script is currently
getting the primary key returned from the standardattributes table
insert to use for the networksegments table insert. However, the
inserted_primary_key attribute returns a list of all of the primary
key values, so this will blow up (at least on MySQL, since it is
trying to insert a list for an integer column.
File "/usr/lib/python2.7/site-packages/alembic/runtime/migration.py", line 312, in run_migrations
step.migration_fn(**kw)
File "/usr/lib/python2.7/site-packages/neutron/db/migration/alembic_migrations/versions/newton/contract/97c25b0d2353_add_name_desc.py", line 74, in upgrade
update_existing_records()
File "/usr/lib/python2.7/site-packages/neutron/db/migration/alembic_migrations/versions/newton/contract/97c25b0d2353_add_name_desc.py", line 61, in update_existing_records
TBL_MODEL.c.id == row[0])
File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 1046, in execute
bind, close_with_result=True).execute(clause, params or {})
File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
return meth(self, multiparams, params)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
compiled_sql, distilled_params
File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
context)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1337, in _handle_dbapi_exception
util.raise_from_cause(newraise, exc_info)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/util/compat.py", line 200, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
context)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
cursor.execute(statement, parameters)
File "/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py", line 174, in execute
self.errorhandler(self, exc, value)
File "/usr/lib64/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
oslo_db.exception.DBError: (_mysql_exceptions.ProgrammingError) (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') WHERE networksegments.id = '5d84887d-ed87-4f5b-8661-6be327d3c541'' at line 1") [SQL: u'UPDATE networksegments SET standard_attr_id=%s WHERE networksegments.id = %s'] [parameters: ([10L], '5d84887d-ed87-4f5b-8661-6be327d3c541')]
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1621490/+subscriptions
References