Run ironic-dbsync with DB2 as database background, found new issue as below:
07:59:42 vs335.rch.kstart.com INFO [alembic.migration] Context impl IBMDBImpl.
07:59:42 vs335.rch.kstart.com INFO [alembic.migration] Will assume transactional DDL.
07:59:42 vs335.rch.kstart.com INFO [alembic.migration] Running upgrade -> 2581ebaf0cb2, initial migration
07:59:42 vs335.rch.kstart.com INFO [alembic.migration] Running upgrade 2581ebaf0cb2 -> 21b331f883ef, Add provision_updated_at
07:59:42 vs335.rch.kstart.com INFO [alembic.migration] Running upgrade 21b331f883ef -> 3cb628139ea4, Nodes add console enabled
07:59:42 vs335.rch.kstart.com INFO [alembic.migration] Running upgrade 3cb628139ea4 -> 31baaf680d2b, Add Node instance info
07:59:42 vs335.rch.kstart.com INFO [alembic.migration] Running upgrade 31baaf680d2b -> 3bea56f25597, add unique constraint to instance_uuid
07:59:42 vs335.rch.kstart.com INFO [alembic.migration] Running upgrade 3bea56f25597 -> 487deb87cc9d, add conductor_affinity and online
07:59:42 vs335.rch.kstart.com INFO [alembic.migration] Running upgrade 487deb87cc9d -> 242cc6a923b3, Add Node.maintenance_reason
07:59:42 vs335.rch.kstart.com INFO [alembic.migration] Running upgrade 242cc6a923b3 -> 5674c57409b9, replace NOSTATE with AVAILABLE
07:59:42 vs335.rch.kstart.com INFO [alembic.migration] Running upgrade 5674c57409b9 -> bb59b63f55a, add_node_driver_internal_info
07:59:42 vs335.rch.kstart.com INFO [alembic.migration] Running upgrade bb59b63f55a -> 3ae36a5f5131, add_logical_name
07:59:42 vs335.rch.kstart.com INFO [alembic.migration] Running upgrade 3ae36a5f5131 -> 1e1d5ace7dc6, add inspection_started_at and inspection_finished_at
07:59:42 vs335.rch.kstart.com INFO [alembic.migration] Running upgrade 1e1d5ace7dc6 -> 4f399b21ae71, Add node.clean_step
07:59:42 vs335.rch.kstart.com INFO [alembic.migration] Running upgrade 4f399b21ae71 -> 2fb93ffd2af1, increase-node-name-length
07:59:42 vs335.rch.kstart.com CRITI [ironic] DBError: (ProgrammingError) ibm_db_dbi::ProgrammingError: Statement Execute Failed: [IBM][CLI Driver][DB2/LINUXX8664] SQL0104N An unexpected token "ALTER TABLE NODES ALTER COLUMN na" was found following "BEGIN-OF-STATEMENT". Expected tokens may include: "<create_variable>". SQLSTATE=42601 SQLCODE=-104 'ALTER TABLE nodes ALTER COLUMN name TYPE VARCHAR(255)' ()
07:59:42 vs335.rch.kstart.com Traceback (most recent call last):
07:59:42 vs335.rch.kstart.com File "/usr/bin/ironic-dbsync", line 10, in <module>
07:59:42 vs335.rch.kstart.com sys.exit(main())
07:59:42 vs335.rch.kstart.com File "/usr/lib/python2.7/site-packages/ironic/cmd/dbsync.py", line 110, in main
07:59:42 vs335.rch.kstart.com CONF.command.func()
07:59:42 vs335.rch.kstart.com File "/usr/lib/python2.7/site-packages/ironic/cmd/dbsync.py", line 36, in upgrade
07:59:42 vs335.rch.kstart.com migration.upgrade(CONF.command.revision)
07:59:42 vs335.rch.kstart.com File "/usr/lib/python2.7/site-packages/ironic/db/migration.py", line 36, in upgrade
07:59:42 vs335.rch.kstart.com return get_backend().upgrade(version)
07:59:42 vs335.rch.kstart.com File "/usr/lib/python2.7/site-packages/ironic/db/sqlalchemy/migration.py", line 56, in upgrade
07:59:42 vs335.rch.kstart.com alembic.command.upgrade(config, revision or 'head')
07:59:42 vs335.rch.kstart.com File "/usr/lib/python2.7/site-packages/alembic/command.py", line 165, in upgrade
07:59:42 vs335.rch.kstart.com script.run_env()
07:59:42 vs335.rch.kstart.com File "/usr/lib/python2.7/site-packages/alembic/script.py", line 382, in run_env
07:59:42 vs335.rch.kstart.com util.load_python_file(self.dir, 'env.py')
07:59:42 vs335.rch.kstart.com File "/usr/lib/python2.7/site-packages/alembic/util.py", line 241, in load_python_file
07:59:42 vs335.rch.kstart.com module = load_module_py(module_id, path)
07:59:42 vs335.rch.kstart.com File "/usr/lib/python2.7/site-packages/alembic/compat.py", line 79, in load_module_py
07:59:42 vs335.rch.kstart.com mod = imp.load_source(module_id, path, fp)
07:59:42 vs335.rch.kstart.com File "/usr/lib/python2.7/site-packages/ironic/db/sqlalchemy/alembic/env.py", line 54, in <module>
07:59:42 vs335.rch.kstart.com run_migrations_online()
07:59:42 vs335.rch.kstart.com File "/usr/lib/python2.7/site-packages/ironic/db/sqlalchemy/alembic/env.py", line 51, in run_migrations_online
07:59:42 vs335.rch.kstart.com context.run_migrations()
07:59:42 vs335.rch.kstart.com File "<string>", line 7, in run_migrations
07:59:42 vs335.rch.kstart.com File "/usr/lib/python2.7/site-packages/alembic/environment.py", line 742, in run_migrations
07:59:42 vs335.rch.kstart.com self.get_context().run_migrations(**kw)
07:59:42 vs335.rch.kstart.com File "/usr/lib/python2.7/site-packages/alembic/migration.py", line 305, in run_migrations
07:59:42 vs335.rch.kstart.com step.migration_fn(**kw)
07:59:42 vs335.rch.kstart.com File "/usr/lib/python2.7/site-packages/ironic/db/sqlalchemy/alembic/versions/2fb93ffd2af1_increase_node_name_length.py", line 35, in upgrade
07:59:42 vs335.rch.kstart.com existing_nullable=True)
07:59:42 vs335.rch.kstart.com File "<string>", line 7, in alter_column
07:59:42 vs335.rch.kstart.com File "<string>", line 1, in <lambda>
07:59:42 vs335.rch.kstart.com File "/usr/lib/python2.7/site-packages/alembic/util.py", line 386, in go
07:59:42 vs335.rch.kstart.com return fn(*arg, **kw)
07:59:42 vs335.rch.kstart.com File "/usr/lib/python2.7/site-packages/alembic/operations.py", line 470, in alter_column
07:59:42 vs335.rch.kstart.com existing_autoincrement=existing_autoincrement
07:59:42 vs335.rch.kstart.com File "/usr/lib/python2.7/site-packages/alembic/ddl/impl.py", line 148, in alter_column
07:59:42 vs335.rch.kstart.com existing_nullable=existing_nullable,
07:59:42 vs335.rch.kstart.com File "/usr/lib/python2.7/site-packages/alembic/ddl/impl.py", line 106, in _exec
07:59:42 vs335.rch.kstart.com return conn.execute(construct, *multiparams, **params)
07:59:42 vs335.rch.kstart.com File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 729, in execute
07:59:42 vs335.rch.kstart.com return meth(self, multiparams, params)
07:59:42 vs335.rch.kstart.com File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 69, in _execute_on_connection
07:59:42 vs335.rch.kstart.com return connection._execute_ddl(self, multiparams, params)
07:59:42 vs335.rch.kstart.com File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 783, in _execute_ddl
07:59:42 vs335.rch.kstart.com compiled
07:59:42 vs335.rch.kstart.com File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 958, in _execute_context
07:59:42 vs335.rch.kstart.com context)
07:59:42 vs335.rch.kstart.com File "/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/compat/handle_error.py", line 261, in _handle_dbapi_exception
07:59:42 vs335.rch.kstart.com e, statement, parameters, cursor, context)
07:59:42 vs335.rch.kstart.com File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1155, in _handle_dbapi_exception
07:59:42 vs335.rch.kstart.com util.raise_from_cause(newraise, exc_info)
07:59:42 vs335.rch.kstart.com File "/usr/lib64/python2.7/site-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause
07:59:42 vs335.rch.kstart.com reraise(type(exception), exception, tb=exc_tb)
07:59:42 vs335.rch.kstart.com File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 951, in _execute_context
07:59:42 vs335.rch.kstart.com context)
07:59:42 vs335.rch.kstart.com File "/usr/lib/python2.7/site-packages/ibm_db_sa/ibm_db.py", line 106, in do_execute
07:59:42 vs335.rch.kstart.com cursor.execute(statement, parameters)
07:59:42 vs335.rch.kstart.com File "/usr/lib64/python2.7/site-packages/ibm_db_dbi.py", line 1335, in execute
07:59:42 vs335.rch.kstart.com self._execute_helper(parameters)
07:59:42 vs335.rch.kstart.com File "/usr/lib64/python2.7/site-packages/ibm_db_dbi.py", line 1247, in _execute_helper
07:59:42 vs335.rch.kstart.com raise self.messages[len(self.messages) - 1]
07:59:42 vs335.rch.kstart.com DBError: (ProgrammingError) ibm_db_dbi::ProgrammingError: Statement Execute Failed: [IBM][CLI Driver][DB2/LINUXX8664] SQL0104N An unexpected token "ALTER TABLE NODES ALTER COLUMN na" was found following "BEGIN-OF-STATEMENT". Expected tokens may include: "<create_variable>". SQLSTATE=42601 SQLCODE=-104 'ALTER TABLE nodes ALTER COLUMN name TYPE VARCHAR(255)' ()
Fix proposed to branch: master /review. openstack. org/173721
Review: https:/