DBDuplicateEntry not being translated for DB2

Bug #1227321 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Medium
Unassigned
OpenStack Compute (nova)
Fix Released
Medium
Matt Riedemann
OpenStack Heat
Fix Released
Low
lvdongbing
OpenStack Identity (keystone)
Fix Released
High
Brant Knudson
neutron
Fix Released
Medium
Xurong Yang
oslo-incubator
Fix Released
Low
Brant Knudson

Bug Description

The tempest.api.compute.keypairs.test_keypairs.test_create_keypair_with_duplicate_name test fails if you're running with a DB2 backend because the nova code is not currently translating the db integrity error if the backing engine is DB2 (ibm_db_sa) in nova.openstack.common.db.sqlalchemy.session._raise_if_duplicate_entry_error.

Per full disclosure, nova is not claiming support for DB2 and there is a lot of work that would need to be done for that which my team is planning for icehouse and there is a blueprint here:

https://blueprints.launchpad.net/nova/+spec/db2-database

My team does have DB2 10.5 working with nova trunk but we have changes to the migration scripts to support that. Also, you have to run with the DB2 patch for sqlalchemy-migrate posted here:

https://code.google.com/p/sqlalchemy-migrate/issues/detail?id=151

And you must run with the ibm-db/ibm-db-sa drivers:

https://code.google.com/p/ibm-db/source/clones?repo=ibm-db-sa

We're trying to get the sqlalchemy-migrate support for DB2 accepted in the icehouse timeframe but need to show the migrate maintainer that he can use the free express-c version of DB2 in ubuntu for the test backend.

Anyway, having said all that, fixing the DBDuplicateEntry translation is part of the story so I'm opening a bug to track it and get the patch up to get the ball rolling.

Tags: db
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo-incubator (master)

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

Changed in oslo:
assignee: nobody → Matt Riedemann (mriedem)
status: New → In Progress
Revision history for this message
David Ripton (dripton) wrote :

Because we don't currently support DB2, I gave this bug minimum priority just to get it out of the new-bugs-to-triage queue. If nobody were working on it I'd mark it closed/wontfix, but since someone is working on it, it's fine to leave it in the tracker for later.

Changed in nova:
importance: Undecided → Wishlist
status: New → Opinion
Matt Riedemann (mriedem)
Changed in oslo:
status: In Progress → New
Revision history for this message
Matt Riedemann (mriedem) wrote :
Revision history for this message
Matt Riedemann (mriedem) wrote :

I'll be working this again for icehouse-3 because the nova blueprint db2-database was approved.

Matt Riedemann (mriedem)
Changed in nova:
assignee: nobody → Matt Riedemann (mriedem)
Dolph Mathews (dolph)
Changed in keystone:
status: New → Triaged
importance: Undecided → Low
Changed in oslo:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Matt Riedemann (mriedem) wrote :

Brant Knudson has the oslo patch here: https://review.openstack.org/#/c/70163/

Apparently we have too many projects connected to this bug report because launchpad won't let me change the owner of the oslo change.

Changed in oslo:
status: Triaged → In Progress
Revision history for this message
Brant Knudson (blk-u) wrote :

Matt - https://review.openstack.org/#/c/70163/ is only for support of connection tracing and not for conflict handling.

Revision history for this message
Brant Knudson (blk-u) wrote :

The change is this one: https://review.openstack.org/#/c/47251/

I'll pick that up since this is affecting Keystone now.

Changed in oslo:
assignee: Matt Riedemann (mriedem) → Brant Knudson (blk-u)
Revision history for this message
Brant Knudson (blk-u) wrote :

This causes a regression for Keystone, since this worked with the db.sqlalchemy code we had before.

Changed in keystone:
importance: Low → High
assignee: nobody → Brant Knudson (blk-u)
milestone: none → icehouse-3
lvdongbing (dbcocle)
Changed in heat:
assignee: nobody → lvdongbing (dbcocle)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

Changed in heat:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo-incubator (master)

Reviewed: https://review.openstack.org/47251
Committed: https://git.openstack.org/cgit/openstack/oslo-incubator/commit/?id=8dccc7bbb64dee9a5b05686024fe642a1ee9aa78
Submitter: Jenkins
Branch: master

commit 8dccc7bbb64dee9a5b05686024fe642a1ee9aa78
Author: Matt Riedemann <email address hidden>
Date: Wed Sep 18 13:51:17 2013 -0700

    Handle ibm_db_sa DBDuplicateEntry integrity errors

    This patch adds duplicate entry integrity error handling for the
    ibm_db_sa driver to the common sqlalchemy db session.

    Closes-Bug: #1227321
    Part of nova blueprint: db2-database

    Change-Id: I2f0d3d660373e4f647615f121fed0da9442f8cd2

Changed in oslo:
status: In Progress → Fix Committed
Changed in oslo:
milestone: none → icehouse-3
Changed in keystone:
status: Triaged → In Progress
Matt Riedemann (mriedem)
Changed in nova:
importance: Wishlist → Medium
Revision history for this message
Matt Riedemann (mriedem) wrote :

The nova patch is part of the db2-database blueprint change here: https://review.openstack.org/#/c/69047/

Changed in nova:
status: Opinion → In Progress
Dolph Mathews (dolph)
Changed in keystone:
milestone: icehouse-3 → icehouse-rc1
Changed in keystone:
assignee: Brant Knudson (blk-u) → Ilya Pekelny (i159)
Revision history for this message
Matt Riedemann (mriedem) wrote :

The nova change is actually handled as part of this sync: https://review.openstack.org/#/c/75922/

Changed in keystone:
assignee: Ilya Pekelny (i159) → Brant Knudson (blk-u)
Matt Riedemann (mriedem)
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in oslo:
status: Fix Committed → Fix Released
Changed in keystone:
assignee: Brant Knudson (blk-u) → Dolph Mathews (dolph)
Dolph Mathews (dolph)
Changed in keystone:
assignee: Dolph Mathews (dolph) → Brant Knudson (blk-u)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/75549
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=8f7b87b2a7d79f52a971becd2cd5d071a15d7b6d
Submitter: Jenkins
Branch: master

commit 8f7b87b2a7d79f52a971becd2cd5d071a15d7b6d
Author: Brant Knudson <email address hidden>
Date: Fri Feb 21 16:22:06 2014 -0600

    Sync db, db.sqlalchemy, gettextutils from oslo-incubator 6ba44fd

    This change sync's oslo-incubator's db module from commit hash
    6ba44fd7f9d39a7930defb4e14c37b8b1046cbcb

     $ python update.py --nodeps --base keystone \
        --dest-dir ../keystone \
        --modules db,db.sqlalchemy,gettextutils

    - Config options were moved from db.sqlalchemy.session to db.options
    - db.sqlalchemy.session doesn't provide get_session, get_engine, or
      cleanup functions.
    - db.sqlalchemy.migration.db_version() requires an engine parameter

    Closes-Bug: #1227321

    Change-Id: I742cef9dab68d9eed977df0039736cfe67ca493c

Changed in keystone:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-rc1
Xurong Yang (idopra)
Changed in cinder:
assignee: nobody → Xurong Yang (idopra)
Changed in glance:
assignee: nobody → Xurong Yang (idopra)
Changed in neutron:
assignee: nobody → Xurong Yang (idopra)
Changed in neutron:
status: New → Triaged
milestone: none → icehouse-rc1
importance: Undecided → High
Changed in neutron:
milestone: icehouse-rc1 → none
importance: High → Medium
Thierry Carrez (ttx)
Changed in keystone:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in oslo:
milestone: icehouse-3 → 2014.1
Thierry Carrez (ttx)
Changed in keystone:
milestone: icehouse-rc1 → 2014.1
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-rc1 → 2014.1
Revision history for this message
John Griffith (john-griffith) wrote :

Not sure of the status in Cinder (oslo moves may cover this) but nobody seems to care as this has been stagnant for a year on cinder.

Feel free to log a new bug if needed.

no longer affects: cinder
Ian Cordasco (icordasc)
Changed in glance:
assignee: Xurong Yang (idopra) → nobody
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Eugene Nikanorov (enikanorov) wrote :

I believe is not a bug for neutron anymore since the fix for oslo.db has been release long time ago.

Changed in neutron:
status: Triaged → Fix Released
Revision history for this message
Viktor Serhieiev (vsergeyev) wrote :

This bug was fixed in common DB code. Glance use it, so this but is not affects Glance

Changed in glance:
status: Triaged → Fix Released
Changed in heat:
importance: Undecided → Low
status: In Progress → Triaged
Revision history for this message
Matt Riedemann (mriedem) wrote :

This was fixed in oslo.db a long time ago and heat uses oslo.db so this is fixed there as well.

Changed in heat:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.