]> git.sur5r.net Git - openldap/commitdiff
More for prev commit - if doing both modrdn and modify at once, only
authorHoward Chu <hyc@openldap.org>
Wed, 3 Dec 2008 04:49:53 +0000 (04:49 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 3 Dec 2008 04:49:53 +0000 (04:49 +0000)
set the CSN on the modify op.

servers/slapd/syncrepl.c

index eaccc3785ec59b742615750a99fb226e2f390c50..f7cf7eb0f55752afbb1ac6e8d81d5ea404606297 100644 (file)
@@ -2208,7 +2208,7 @@ retry_add:;
                if ( dni.renamed ) {
                        struct berval noldp, newp;
                        Modifications *mod, **modtail, **ml, *m2;
-                       int i, got_replace = 0;
+                       int i, got_replace = 0, just_rename = 0;
 
                        op->o_tag = LDAP_REQ_MODRDN;
                        dnRdn( &entry->e_name, &op->orr_newrdn );
@@ -2368,8 +2368,12 @@ retry_add:;
                                 */
                                if ( dni.mods ) {
                                        mod = dni.mods;
+                                       /* don't set a CSN for the rename op */
+                                       if ( syncCSN )
+                                               slap_graduate_commit_csn( op );
                                } else {
                                        mod = op->orr_modlist;
+                                       just_rename = 1;
                                }
                                for ( ; mod->sml_next; mod=mod->sml_next );
                                mod->sml_next = m2;
@@ -2387,6 +2391,9 @@ retry_add:;
                        /* Renamed entries may still have other mods so just fallthru */
                        op->o_req_dn = entry->e_name;
                        op->o_req_ndn = entry->e_nname;
+                       /* Use CSN on the modify */
+                       if ( syncCSN && !just_rename )
+                               slap_queue_csn( op, syncCSN );
                }
                if ( dni.mods ) {
                        op->o_tag = LDAP_REQ_MODIFY;