]> git.sur5r.net Git - openldap/commitdiff
ITS#5988 avoid redundant slap_graduate_commit_csn calls
authorHoward Chu <hyc@openldap.org>
Sat, 14 Mar 2009 01:04:55 +0000 (01:04 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 14 Mar 2009 01:04:55 +0000 (01:04 +0000)
servers/slapd/syncrepl.c

index 76b9ec1a97c4e11bbff14032787d0d678f1b9dac..01b4cf6b502c4b47c73c1003bce144c94766f140 100644 (file)
@@ -2241,6 +2241,7 @@ retry_add:;
                                        si->si_ridtxt, rs_add.sr_err, 0 );
                                break;
                        }
+                       syncCSN = NULL;
                        op->o_bd = be;
                        goto done;
                }
@@ -2440,7 +2441,9 @@ retry_add:;
                        op->o_req_dn = entry->e_name;
                        op->o_req_ndn = entry->e_nname;
                        /* Use CSN on the modify */
-                       if ( syncCSN && !just_rename )
+                       if ( just_rename )
+                               syncCSN = NULL;
+                       else if ( syncCSN )
                                slap_queue_csn( op, syncCSN );
                }
                if ( dni.mods ) {
@@ -2460,11 +2463,16 @@ retry_add:;
                                        "syncrepl_entry: %s be_modify failed (%d)\n",
                                        si->si_ridtxt, rs_modify.sr_err, 0 );
                        }
+                       syncCSN = NULL;
                        op->o_bd = be;
                } else if ( !dni.renamed ) {
                        Debug( LDAP_DEBUG_SYNC,
                                        "syncrepl_entry: %s entry unchanged, ignored (%s)\n", 
                                        si->si_ridtxt, op->o_req_dn.bv_val, 0 );
+                       if ( syncCSN ) {
+                               slap_graduate_commit_csn( op );
+                               syncCSN = NULL;
+                       }
                }
                goto done;
        case LDAP_SYNC_DELETE :
@@ -2493,6 +2501,7 @@ retry_add:;
                                        break;
                                }
                        }
+                       syncCSN = NULL;
                        op->o_bd = be;
                }
                goto done;