Hide Forgot
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 }}}
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 - ------------------------------------------
[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.
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