Bug 1852383

Summary: _mysql_exceptions.OperationalError - DBDeadlock when update_user is called within Keystone
Product: Red Hat OpenStack Reporter: Dariusz Wojewódzki <dwojewod>
Component: openstack-keystoneAssignee: Grzegorz Grasza <ggrasza>
Status: CLOSED ERRATA QA Contact: Jeremy Agee <jagee>
Severity: high Docs Contact:
Priority: high    
Version: 13.0 (Queens)CC: alee, dwilde, hrybacki, lbragsta, oblaut
Target Milestone: z16Keywords: Triaged, ZStream
Target Release: 13.0 (Queens)   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: openstack-keystone-13.0.4-7.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-06-16 10:58:53 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:

Description Dariusz Wojewódzki 2020-06-30 10:08:58 UTC
Description of problem:

Failed user operations on keystone.
Problem is related to creation or updating user information on keystone side

Version-Release number of selected component (if applicable):
openstack-keystone-13.0.2-6.el7ost.noarch
memcached-1.4.39-2.el7ost.x86_64     



Actual results:

When update_user is called within Keystone it leads to a Deadlock on the DB.

Error logs like below occur often in the cluster. 

020-06-29 14:42:38.694 40239 ERROR keystone.common.wsgi [req-1faddeb5-1ee6-4a2a-8b20-cea5ca3f5a09 5d151d3afb574af78c6f2757ffdd1f18 9b4e9d2b80b74bea926636fb0f4f0519 - default default] (_mysql_exceptions.OperationalError) (1213, 'Deadlock found when trying to get lock; try restarting transaction') [SQL: u'DELETE FROM password WHERE password.id = %s'] [parameters: ((31144958L,), (31144961L,), (31144963L,), (31144964L,), (31144968L,), (31144969L,), (31144970L,), (31144972L,)  ... displaying 10 of 13 total bound parameter sets ...  (31144976L,), (31144978L,))] (Background on this error at: http://sqlalche.me/e/e3q8): DBDeadlock: (_mysql_exceptions.OperationalError) (1213, 'Deadlock found when trying to get lock; try restarting transaction') [SQL: u'DELETE FROM password WHERE password.id = %s'] [parameters: ((31144958L,), (31144961L,), (31144963L,), (31144964L,), (31144968L,), (31144969L,), (31144970L,), (31144972L,)  ... displaying 10 of 13 total bound parameter sets ...  (31144976L,), (31144978L,))] (Background on this error at: http://sqlalche.me/e/e3q8)
2020-06-29 14:42:38.694 40239 ERROR keystone.common.wsgi Traceback (most recent call last):
2020-06-29 14:42:38.694 40239 ERROR keystone.common.wsgi   File "/usr/lib/python2.7/site-packages/keystone/common/wsgi.py", line 226, in __call__

020-06-29 14:42:44.226 39779 ERROR keystone.common.wsgi [req-bc1cc682-b2d9-4374-b543-f850d7485f00 5d151d3afb574af78c6f2757ffdd1f18 9b4e9d2b80b74bea926636fb0f4f0519 - default default] UPDATE statement on table 'password' expected to update 1 row(s); 0 were matched.: StaleDataError: UPDATE statement on table 'password' expected to update 1 row(s); 0 were matched.
2020-06-29 14:42:44.226 39779 ERROR keystone.common.wsgi Traceback (most recent call last):
2020-06-29 14:42:44.226 39779 ERROR keystone.common.wsgi   File "/usr/lib/python2.7/site-packages/keystone/common/wsgi.py", line 226, in __call__

Comment 39 errata-xmlrpc 2021-06-16 10:58:53 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 (Red Hat OpenStack Platform 13.0 bug fix and enhancement 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-2021:2385