]> git.sur5r.net Git - openldap/commitdiff
import fix to ITS#5170
authorPierangelo Masarati <ando@openldap.org>
Fri, 5 Oct 2007 12:03:57 +0000 (12:03 +0000)
committerPierangelo Masarati <ando@openldap.org>
Fri, 5 Oct 2007 12:03:57 +0000 (12:03 +0000)
CHANGES
servers/slapd/syncrepl.c

diff --git a/CHANGES b/CHANGES
index 587d57730d66b584b99482e25e1af80f6c77b05c..9ee325a90681925fa3e45e0c223d6432aa51f107 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -8,6 +8,7 @@ OpenLDAP 2.4.6 Engineering
        Fixed slapd X509 parsing (ITS#5070, #5151)
        Fixed slapd slap_passwd_parse (ITS#5159)
        Added slapd attribute value sorting (ITS#5153)
+       Fixed slapd syncrepl cookie propagation (ITS#5170)
        Fixed slapd-bdb/hdb suffix logging (ITS#5128)
        Fixed slapd-bdb/hdb IDL LRU handling (ITS#5121)
        Fixed slapd-bdb/hdb cachesize config check (ITS#5122)
index a657088bed3fec522844fc5fc38ecde27c922a88..4a778d743cd6791a4c1a85ef761964cc321e2a13 100644 (file)
@@ -112,7 +112,8 @@ static int syncrepl_message_to_entry(
                                        Modifications **, Entry **, int );
 static int syncrepl_entry(
                                        syncinfo_t *, Operation*, Entry*,
-                                       Modifications**,int, struct berval* );
+                                       Modifications**,int, struct berval*,
+                                       struct berval *cookieCSN );
 static int syncrepl_updateCookie(
                                        syncinfo_t *, Operation *, struct berval *,
                                        struct sync_cookie * );
@@ -817,7 +818,7 @@ do_syncrep2(
                                        &modlist, &entry, syncstate ) ) == LDAP_SUCCESS )
                                {
                                        if ( ( rc = syncrepl_entry( si, op, entry, &modlist,
-                                               syncstate, &syncUUID ) ) == LDAP_SUCCESS &&
+                                               syncstate, &syncUUID, syncCookie.ctxcsn ) ) == LDAP_SUCCESS &&
                                                syncCookie.ctxcsn )
                                        {
                                                rc = syncrepl_updateCookie( si, op, psub, &syncCookie );
@@ -1829,7 +1830,8 @@ syncrepl_entry(
        Entry* entry,
        Modifications** modlist,
        int syncstate,
-       struct berval* syncUUID )
+       struct berval* syncUUID,
+       struct berval* syncCSN )
 {
        Backend *be = op->o_bd;
        slap_callback   cb = { NULL, NULL, NULL, NULL };
@@ -1960,12 +1962,17 @@ syncrepl_entry(
        }
 
        assert( BER_BVISNULL( &op->o_csn ) );
+       if ( syncCSN ) {
+               slap_queue_csn( op, syncCSN );
+       }
 
        slap_op_time( &op->o_time, &op->o_tincr );
        switch ( syncstate ) {
        case LDAP_SYNC_ADD:
        case LDAP_SYNC_MODIFY:
+               if ( BER_BVISNULL( &op->o_csn ))
                {
+
                        Attribute *a = attr_find( entry->e_attrs, slap_schema.si_ad_entryCSN );
                        if ( a ) {
                                /* FIXME: op->o_csn is assumed to be
@@ -2211,6 +2218,9 @@ done:
        if ( entry ) {
                entry_free( entry );
        }
+       if ( syncCSN ) {
+               slap_graduate_commit_csn( op );
+       }
        if ( !BER_BVISNULL( &op->o_csn ) && freecsn ) {
                op->o_tmpfree( op->o_csn.bv_val, op->o_tmpmemctx );
        }