Bug 1417338

Summary: To debug DB_DEADLOCK condition, allow to reset DB_TXN_NOWAIT flag on txn_begin
Product: Red Hat Enterprise Linux 7 Reporter: Noriko Hosoi <nhosoi>
Component: 389-ds-baseAssignee: thierry bordaz <tbordaz>
Status: CLOSED ERRATA QA Contact: Viktor Ashirov <vashirov>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.3CC: mreynolds, nkinder, rmeggins, spichugi, tbordaz
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 389-ds-base-1.3.6.1-4.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 21:14:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Noriko Hosoi 2017-01-28 02:11:28 UTC
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/389/ticket/49076

DB_DEADLOCK can happen quite frequently this is why transactions are started with DB_TXN_NOWAIT and deadlock is managed (retry) by backend code.

When there are too many retries (49), the operation fails.
The problem is that when the operation fails (because of too many deadlocks) it is difficult to identify the threads that triggered the deadlock and propose workarounds.

For debug reason it could be interesting to have a new configuration option 'nsslapd-db-txn-begin-flags' (in 'cn=config,cn=ldbm database,cn=plugins,cn=config') to call txn_begin.
By default the option is DB_TXN_NOWAIT

Comment 1 thierry bordaz 2017-03-22 14:46:17 UTC
Upstream ticket pushed https://pagure.io/389-ds-base/issue/49076

Comment 3 Simon Pichugin 2017-05-31 17:25:11 UTC
Automated test case can be found at dirsrvtests/tests/tickets/ticket49076_test.py:

===================== test session starts =====================
platform linux2 -- Python 2.7.5, pytest-3.1.1, py-1.4.33, pluggy-0.4.0 -- /usr/bin/python
cachedir: .cache
metadata: {'Python': '2.7.5', 'Platform': 'Linux-3.10.0-671.el7.x86_64-x86_64-with-redhat-7.4-Maipo', 'Packages': {'py': '1.4.33', 'pytest': '3.1.1', 'pluggy': '0.4.0'}, 'Plugins': {'beakerlib': '0.7.1', 'html': '1.14.2', 'cov': '2.5.1', 'metadata': '1.5.0'}}
DS build: 1.3.6.1
389-ds-base: 1.3.6.1-15.el7
nss: 3.28.4-8.el7
nspr: 4.13.1-1.0.el7_3
openldap: 2.4.44-4.el7
svrcore: 4.1.3-2.el7

rootdir: /export/tests, inifile:
plugins: metadata-1.5.0, html-1.14.2, cov-2.5.1, beakerlib-0.7.1
collected 1 items

tickets/ticket49076_test.py::test_ticket49076 PASSED

===================== 1 passed in 8.41 seconds =====================

Marking as verified.

Comment 4 errata-xmlrpc 2017-08-01 21:14: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:2086