Bug 834064

Summary: dnaNextValue gets incremented even if the user addition fails
Product: Red Hat Enterprise Linux 6 Reporter: Nathan Kinder <nkinder>
Component: 389-ds-baseAssignee: Rich Megginson <rmeggins>
Status: CLOSED ERRATA QA Contact: Sankar Ramalingam <sramling>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 6.4CC: jgalipea, jrusnack, mreynolds, sdharane
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 389-ds-base-1.2.11.12-1.el6 Doc Type: Bug Fix
Doc Text:
Cause: we incremented the count in the pre opstage Consequence: If the update failed, the counter was still incremented. Fix: If the operation fails, undo the changes in the be txn pre op. Result: dna counter is not incremented.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 08:19:43 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 Nathan Kinder 2012-06-20 18:15:19 UTC
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/389/ticket/211

https://bugzilla.redhat.com/show_bug.cgi?id=510182

{{{
Description of problem:
The setup is a single instance DNA plugin enabled. The dnaNextValue counter
gets incremented even if there is a failure in addition of the user. Therefore
creating gaps in number assignment and resulting in non utilization of a valid
number in range.

Version-Release number of selected component (if applicable):
RHDS 9.0

How reproducible:
Everytime

Steps to Reproduce:
1. Enable DNA Plugin
2. Add the entry below, to enable DNA for uidNumber attribute.
dn: cn=Account UIDs,cn=Distributed Numeric Assignment
Plugin,cn=plugins,cn=config
objectClass: top
objectClass: extensibleObject
cn: Account UIDs
dnatype: uidNumber
dnafilter: (objectclass=posixAccount)
dnascope: dc=pnq,dc=redhat,dc=com
dnanextvalue: 1
dnamaxvalue: 1300

3. Restart server.
4. Add a user and see if the DNA plugin is working as expected and the
dnaNextValue number get incremented. (This is happening correctly).
5. Add a user without gidNumber attribute, which will fail as DNA is not
enabled for gidNumber in this setup.
6. Check dnaNextValue. It would have got incremented even though the user
addition is failed.

Actual results:
dnaNextValue get incremented even if the user addition fails.

Expected results:
dnaNextValue should not get incremented if the user addition fails.

Additional info:
}}}

Comment 1 Nathan Kinder 2012-06-21 04:42:56 UTC
*** Bug 510182 has been marked as a duplicate of this bug. ***

Comment 2 RHEL Program Management 2012-07-10 06:17:15 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 3 RHEL Program Management 2012-07-10 23:02:21 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 4 Jenny Severance 2012-08-14 13:08:57 UTC
test coverage :: bug834064_1 bug834064_2 bug834064_3 in dna/dnarun.sh

Comment 6 Ján Rusnačko 2012-11-12 17:14:47 UTC
520|0 4 27814 1 2|----------------- Starting Test bug834064_2 -------------------------
520|0 4 27814 1 3|DNA SCENARIO BUG 834064: dnaNextValue gets incremented even if the user addition fails
520|0 4 27814 1 4|                                                                  
520|0 4 27814 1 5|Adding user 1 with GID - running /usr/lib64/mozldap/ldapmodify -h dstet.example.com -p 27557 -D cn=directory manager -w Secret123 -a -f /dstet/dstet-trunk/tet/../data/DS/6.0/dna/en/bug834064_data/add1.ldif
520|0 4 27814 1 6|TestCase [bug834064_2] result-> [PASS]
520|0 4 27814 1 7|                       
520|0 4 27814 1 8|Verify user 1 uidNumber
520|0 4 27814 1 9|TestCase [bug834064_2] result-> [PASS]
520|0 4 27814 1 10|                                                   
520|0 4 27814 1 11|Verify that DNA attribute dnaNextValue incremented
520|0 4 27814 1 12|cn=Distributed Numeric Assignment Plugin,cn=plugins,cn=config, dnanextvalue, 27557, 2
520|0 4 27814 1 13|/usr/lib64/mozldap/ldapsearch -1 -h dstet.example.com -p 27557 -D "cn=directory manager" -w Secret123 -b "cn=Distributed Numeric Assignment Plugin,cn=plugins,cn=config" "(objectclass=*)"
520|0 4 27814 1 14|DNA attribute dnanextvalue is as expected: 2
520|0 4 27814 1 15|TestCase [bug834064_2] result-> [PASS]
520|0 4 27814 1 16|                                               
520|0 4 27814 1 17|Adding user 2 without GID - running /usr/lib64/mozldap/ldapmodify -h dstet.example.com -p 27557 -D cn=directory manager -w Secret123 -a -f /dstet/dstet-trunk/tet/../data/DS/6.0/dna/en/bug834064_data/add2.ldif
520|0 4 27814 1 18|TestCase [bug834064_2] result-> [PASS]
520|0 4 27814 1 19|                           
520|0 4 27814 1 20|Verify that DNA next value did not increment upon unsuccessful addition of user 2
520|0 4 27814 1 21|cn=Distributed Numeric Assignment Plugin,cn=plugins,cn=config, dnanextvalue, 27557, 2
520|0 4 27814 1 22|/usr/lib64/mozldap/ldapsearch -1 -h dstet.example.com -p 27557 -D "cn=directory manager" -w Secret123 -b "cn=Distributed Numeric Assignment Plugin,cn=plugins,cn=config" "(objectclass=*)"
520|0 4 27814 1 23|DNA attribute dnanextvalue is as expected: 2
520|0 4 27814 1 24|TestCase [bug834064_2] result-> [PASS]

version: 389-ds-base-1.2.11.15-3.el6.x86_64

Closing as verified.

Comment 7 errata-xmlrpc 2013-02-21 08:19:43 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.

http://rhn.redhat.com/errata/RHSA-2013-0503.html