← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1188785] Re: keystone-manage db_sync with DB2 fails

 

** Changed in: keystone
       Status: Fix Committed => Fix Released

** Changed in: keystone
    Milestone: None => havana-2

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1188785

Title:
  keystone-manage db_sync with DB2 fails

Status in OpenStack Identity (Keystone):
  Fix Released

Bug description:
  I set up my system with DB2 according to
  https://wiki.openstack.org/wiki/DB2Enablement

  Ran keystone-manage db_sync, and got this error:

  ...
   File "/opt/stack/keystone/keystone/common/sql/migrate_repo/versions/011_endpoints_v3.py", line 26, in upgrade
      legacy_table.rename('endpoint_v2')
  ...
  sqlalchemy.exc.ProgrammingError: (ProgrammingError)
  ibm_db_dbi::ProgrammingError: Statement Execute Failed:
  [IBM][CLI Driver][DB2/LINUXX8664] SQL0750N
  The statement failed because the table or column cannot be renamed.
  SQLSTATE=42986 SQLCODE=-750 'RENAME TABLE endpoint TO endpoint_v2' ()

  The problem is that DB2 will not allow you to rename a table if it's got a constraint on it (a unique or foreign key constraint). See
  http://pic.dhe.ibm.com/infocenter/db2luw/v10r1/index.jsp?topic=%2Fcom.ibm.db2.luw.admin.dbobj.doc%2Fdoc%2Ft0020130.html

  The suggested fix for this is to drop the unique or FK constraints
  before renaming and then restoring the FK constraints.

  The FK constraint problem affects migrations 11 and 13. The unique
  constraint problem affects migration 16.

  The next problem is that the upgrade process deadlocks in migration
  16. This is because with DB2 a lock is held in
  upgrade_user_table_with_col_create and it's not released with a
  commit(), then later upgrade_project_table_with_col_create tries to
  get the same lock and now we're deadlocked. The suggested fix is to
  commit the transaction in upgrade_user_table_with_col_create.

  Also ran into a similar problem as mysql on migration 23, but ayoung
  has a fix for this.

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1188785/+subscriptions