Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1427818

Summary: [backport] exception translation for pymysql "Lock wait timeout exceeded" broken Edit
Product: Red Hat OpenStack Reporter: Aviv Guetta <aguetta>
Component: python-oslo-dbAssignee: Michael Bayer <mbayer>
Status: CLOSED ERRATA QA Contact: Asaf Hirshberg <ahirshbe>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.0 (Liberty)CC: apevec, dcadzow, dciabrin, dwojewod, fdinitto, jjoyce, lhh, mbayer, mschuppe, pablo.iranzo, ushkalim
Target Milestone: asyncKeywords: FeatureBackport, Triaged, ZStream
Target Release: 8.0 (Liberty)   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: python-oslo-db-2.6.0-5.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1428026 (view as bug list) Environment:
Last Closed: 2017-06-20 12:48:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
runs a mysql deadlock through oslo.db none

Description Aviv Guetta 2017-03-01 10:16:38 UTC
** exception translation for pymysql "Lock wait timeout exceeded" broken Edit

- Backport request for upstream bug:

https://bugs.launchpad.net/oslo.db/+bug/1608691.

- There is already a backport for mitaka:
https://review.openstack.org/350161.

- We would like to have a backport to OSP 8.

Comment 2 Michael Bayer 2017-03-01 15:57:30 UTC
the mitaka backport was released in oslo.db 4.7.1: https://review.openstack.org/#/c/352370/

however our own python-oslo-db for rhos-9.0 is still on 4.6.0: http://pkgs.devel.redhat.com/cgit/rpms/python-oslo-db/tree/python-oslo-db.spec?h=rhos-9.0-rhel-7

so this backport should be across both rhos-9.0 and rhos-8.0.

Comment 11 Michael Bayer 2017-03-20 13:48:58 UTC
Created attachment 1264761 [details]
runs a mysql deadlock through oslo.db

here's how to test this:

1. environment has a running MariaDB server, with the usual "root"/ "no password" login (we can add a password to the script if need be)

2. environment has target version of oslo.db installed

3. run script:

    python oslo_db_deadlock.py

output will show a bunch of SQL, then end with a stack trace, at the bottom will be:

    oslo_db.exception.DBDeadlock: (pymysql.err.InternalError) (1205, u'Lock wait timeout exceeded; try restarting transaction') [SQL: 'select * from x for update']


if the patch *didn't* work, then you will see:

    oslo_db.exception.DBError: (pymysql.err.InternalError) (1205, u'Lock wait timeout exceeded; try restarting transaction') [SQL: 'select * from x for update']

Comment 12 Asaf Hirshberg 2017-03-23 07:01:12 UTC
Verified.

[root@controller-0 heat-admin]# rpm -qa |grep python-oslo-db
python-oslo-db-2.6.0-5.el7ost.noarch
[root@controller-0 heat-admin]# cat /usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/exc_filters.py |sed -n '61p'
@filters("mysql", sqla_exc.DatabaseError,
[root@controller-0 heat-admin]#

Comment 15 errata-xmlrpc 2017-06-20 12:48:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:1542