Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1044153 - mods optimizer
mods optimizer
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: 389-ds-base (Show other bugs)
7.0
Unspecified Unspecified
low Severity unspecified
: rc
: ---
Assigned To: Rich Megginson
Viktor Ashirov
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-12-17 16:30 EST by Nathan Kinder
Modified: 2015-03-05 04:31 EST (History)
3 users (show)

See Also:
Fixed In Version: 389-ds-base-1.3.3.1-1.el7
Doc Type: Bug Fix
Doc Text:
Cause: a Consequence: Fix: Result:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-05 04:31:43 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0416 normal SHIPPED_LIVE Important: 389-ds-base security, bug fix, and enhancement update 2015-03-05 09:26:33 EST

  None (edit)
Description Nathan Kinder 2013-12-17 16:30:36 EST
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/389/ticket/411

Comparing the following 2 mods in one modify, the first one is much faster.
Tested wit 10K values, the first case took 23 sec. vs. the second 80 sec.
{{{
mods[0].mod_op: LDAP_MOD_ADD
mods[0].mod_type: uniqueMember
mods[0].mod_values: <value_0>
                    <value_1>
                       ...
                    <value_N>

mods[0].mod_op: LDAP_MOD_ADD
mods[0].mod_type: uniqueMember
mods[0].mod_values: <value_0>
mods[1].mod_op: LDAP_MOD_ADD
mods[1].mod_type: uniqueMember
mods[1]mod_values: <value_1>
         ...
mods[N].mod_op: LDAP_MOD_ADD
mods[N].mod_type: uniqueMember
mods[N]mod_values: <value_N>
}}}

We may be able to introduce mods optimizer for some cases like the above.

Note: there are some operations which should not be optimized/cancelled.
For instance, mods could be used for check-and-increment as follows.  In the example, if foo=1 does not exist, the modify should fail and the next add should not happen.
{{{
mods[0].mod_op: LDAP_MOD_DELETE
mods[0].mod_type: foo
mods[0].mod_values: 1
mods[1].mod_op: LDAP_MOD_ADD
mods[1].mod_type: foo
mods[1]mod_values: 2
}}}
Comment 3 mreynolds 2014-10-23 14:17:30 EDT
Verification Steps

[1]  Install DS
[2]  Enable "audit" logging

# ldapmodify ...
dn: cn=config
changetype: modify
replace: nsslapd-auditlog-logging-enabled
nsslapd-auditlog-logging-enabled: on

[3] Add an entry:

dn: uid=user,dc=example,dc=com
uid: user
givenName: user
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetorgperson
sn: user
cn: user
description: 1
description: 2
description: 3

[4]  Remove each description attribute separately

# ldapmodify ...
dn: uid=user,dc=example,dc=com
changetype: modify
delete: description
description: 1
-
delete: description
description: 2
-
delete: description
description: 3

Internally it will get converted to the following format - which is much more efficient:

dn: uid=user,dc=example,dc=com
changetype: modify
delete: description
description: 1
description: 2
description: 3

[5]  Verify that this is how the modify operation appears in the audit log:

------------------------------------------
time: 20141023140935
dn: uid=user,dc=example,dc=com
changetype: modify
delete: description
description: 1
description: 2
description: 3
-
replace: modifiersname
modifiersname: cn=directory manager
-
replace: modifytimestamp
modifytimestamp: 20141023180935Z
-
------------------------------------------
Comment 4 Amita Sharma 2015-01-07 02:25:39 EST
[root@dhcp201-126 export]# ldapmodify -a -p 389 -h localhost -D "cn=Directory Manager" -w Secret123 << EOF> dn: cn=config
> changetype: modify
> replace: nsslapd-auditlog-logging-enabled
> nsslapd-auditlog-logging-enabled: on
> EOF
modifying entry "cn=config"

[root@dhcp201-126 export]# ldapmodify -a -p 389 -h localhost -D "cn=Directory Manager" -w Secret123 << EOF
> dn: uid=user,dc=example,dc=com
> uid: user
> givenName: user
> objectClass: top
> objectClass: person
> objectClass: organizationalPerson
> objectClass: inetorgperson
> sn: user
> cn: user
> description: 1
> description: 2
> description: 3
> EOF
adding new entry "uid=user,dc=example,dc=com"

[root@dhcp201-126 export]# ldapmodify -a -p 389 -h localhost -D "cn=Directory Manager" -w Secret123 << EOF
> dn: uid=user,dc=example,dc=com
> changetype: modify
> delete: description
> description: 1
> -
> delete: description
> description: 2
> -
> delete: description
> description: 3
> EOF
modifying entry "uid=user,dc=example,dc=com"

[root@dhcp201-126 export]# tail -f /var/log/dirsrv/slapd-dhcp201-126/audit
description: 2
description: 3
-
replace: modifiersname
modifiersname: cn=directory manager
-
replace: modifytimestamp
modifytimestamp: 20150107072453Z
-

Marking as VERIFIED.
Comment 6 errata-xmlrpc 2015-03-05 04:31:43 EST
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://rhn.redhat.com/errata/RHSA-2015-0416.html

Note You need to log in before you can comment on or make changes to this bug.