]> git.sur5r.net Git - openldap/commitdiff
ITS#5935
authorQuanah Gibson-Mount <quanah@openldap.org>
Tue, 10 Feb 2009 06:28:10 +0000 (06:28 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 10 Feb 2009 06:28:10 +0000 (06:28 +0000)
CHANGES
servers/slapd/syncrepl.c
tests/scripts/test049-sync-config

diff --git a/CHANGES b/CHANGES
index 831dedb5ed9f5519941b492f2abc24cd0a857871..67cddd999b33952069f7facb7e21f6061d86c8bd 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -32,6 +32,7 @@ OpenLDAP 2.4.14 Engineering
        Fixed slapd syncrepl replication with glued DB (ITS#5866)
        Fixed slapd syncrepl replication with moddn (ITS#5901)
        Fixed slapd syncrepl replication with referrals (ITS#5881)
+       Fixed slapd syncrepl replication with config tree (ITS#5935)
        Fixed slapd wake_sds close on Windows (ITS#5855)
        Fixed slapd-bdb/hdb dncachesize handling (ITS#5860)
        Fixed slapd-bdb/hdb RFC4528 control support (ITS#5861)
index e2c570937b44ddb92c29b3ceca5a2ca7cc9d0fa9..6a81f4d59f9edc0969f029ef876cae9be9bde362 100644 (file)
@@ -1442,22 +1442,7 @@ reload:
 
        /* Do final delete cleanup */
        if ( !si->si_ctype ) {
-               cookie_state *cs = NULL;
-               syncinfo_t **sip;
-
-               cs = be->be_syncinfo->si_cookieState;
-               for ( sip = &be->be_syncinfo; *sip != si; sip = &(*sip)->si_next );
-               *sip = si->si_next;
                syncinfo_free( si, 0 );
-               if ( !be->be_syncinfo ) {
-                       SLAP_DBFLAGS( be ) &= ~(SLAP_DBFLAG_SHADOW|SLAP_DBFLAG_SYNC_SHADOW);
-                       if ( cs ) {
-                               ch_free( cs->cs_sids );
-                               ber_bvarray_free( cs->cs_vals );
-                               ldap_pvt_thread_mutex_destroy( &cs->cs_mutex );
-                               ch_free( cs );
-                       }
-               }
        }
        return NULL;
 }
@@ -4538,9 +4523,11 @@ syncrepl_config( ConfigArgs *c )
                                         * happen when running on the cn=config DB.
                                         */
                                        if ( si->si_re ) {
-                                               ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
-                                               isrunning = ldap_pvt_runqueue_isrunning( &slapd_rq, si->si_re );
-                                               ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
+                                               if ( ldap_pvt_thread_mutex_trylock( &si->si_mutex )) {
+                                                       isrunning = 1;
+                                               } else {
+                                                       ldap_pvt_thread_mutex_unlock( &si->si_mutex );
+                                               }
                                        }
                                        if ( si->si_re && isrunning ) {
                                                si->si_ctype = 0;
@@ -4557,6 +4544,7 @@ syncrepl_config( ConfigArgs *c )
                if ( !c->be->be_syncinfo ) {
                        SLAP_DBFLAGS( c->be ) &= ~SLAP_DBFLAG_SHADOW_MASK;
                        if ( cs ) {
+                               ch_free( cs->cs_sids );
                                ber_bvarray_free( cs->cs_vals );
                                ldap_pvt_thread_mutex_destroy( &cs->cs_mutex );
                                ch_free( cs );
index 5d967c55e66c86aeb27e2e62a0e218a48426f3f1..dc687076f334a033e1c65805bc577460055b67bb 100755 (executable)
@@ -315,6 +315,18 @@ if test $RC != 0 ; then
        exit $RC
 fi
 
+echo "Replacing olcSyncrepl on producer..."
+$LDAPMODIFY -D cn=config -H $URI1 -y $CONFIGPWF <<EOF >> $TESTOUT 2>&1
+dn: olcDatabase={0}config,cn=config
+changetype: modify
+replace: olcSyncRepl
+olcSyncRepl: rid=002 provider=$URI1 binddn="cn=config" bindmethod=simple
+  credentials=$CONFIGPW searchbase="cn=config" type=refreshAndPersist
+  retry="3 5 300 5" timeout=3
+EOF
+echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+sleep $SLEEP1
+
 echo "Using ldapsearch to read config from the producer..."
 $LDAPSEARCH -b cn=config -D cn=config -H $URI1 -y $CONFIGPWF  \
        'objectclass=*' > $MASTEROUT 2>&1