Friday, July 11, 2014

[389-commits] ldap/servers

ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c | 263 ++++++++++++++++-----------
1 file changed, 163 insertions(+), 100 deletions(-)

New commits:
commit 85016a82989a7fd5e185a298b19ff31d81f1bc2e
Author: Thierry bordaz (tbordaz) <tbordaz@redhat.com>
Date: Thu Jul 10 14:05:16 2014 +0200

Ticket 47797 - DB deadlock when two threads (on separated backend) try to record changes in retroCL

Bug Description:
The DB is opened so that if a db lock can not be granted it does not wait and returns DB_DEADLOCK
In some part of code, the server just loops retrying where it should abort the txn (and release the locks
it may hold) and retry with a different txn

Fix Description:
If DB_LOCK_DEADLOCK is returned, the correct course of action is to abort the (possibly nested) transaction
and retry the database operation
file:///usr/share/doc/db4-devel-4.7.25/gsg_txn/C/lockingsubsystem.html

Resolving Deadlocks

When DB determines that a deadlock has occurred, it will select a thread of control to
resolve the deadlock and then return DB_LOCK_DEADLOCK to that thread.
If a deadlock is detected, the thread must:
Cease all read and write operations.
Close all open cursors.
Abort the transaction.
Optionally retry the operation. If your application retries deadlocked operations, the new attempt must be made using a new transaction.

https://fedorahosted.org/389/ticket/47797

Reviewed by: Rich and Mark (Thanks)

Platforms tested: F17/F20 (ipa unit tests)

Flag Day: no

Doc impact: no

diff --git a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c
index d4039e4..8cf5749 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c
@@ -113,15 +113,15 @@ static int _entryrdn_open_index(backend *be, struct attrinfo **ai, DB **dbp);
static char *_entryrdn_encrypt_key(backend *be, const char *key, struct attrinfo *ai);
static char *_entryrdn_decrypt_key(backend *be, const char *key, struct attrinfo *ai);

No comments:

Post a Comment