]> git.sur5r.net Git - openldap/commitdiff
For test063
authorHoward Chu <hyc@openldap.org>
Wed, 31 Aug 2011 02:14:56 +0000 (19:14 -0700)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 6 Sep 2011 19:53:19 +0000 (12:53 -0700)
add hex timestamp to lutil_debug() output
Fix LASTMOD race condition in accesslog.c
Set refreshInterval even if using refreshAndPersist, since
fallbacks will use refresh params

libraries/liblber/debug.c
servers/slapd/overlays/accesslog.c
tests/scripts/test063-delta-multimaster

index 277eecae630f7b8c7ce8e5cb0fd69c2a8ea6dfa7..cc38e85b44919e4b08d40e4ead4b3ff153caab4a 100644 (file)
@@ -62,8 +62,9 @@ void (lutil_debug)( int debug, int level, const char *fmt, ... )
        }
 #endif
 
+       sprintf(buffer, "%08x ", time(0L));
        va_start( vl, fmt );
-       vsnprintf( buffer, sizeof(buffer), fmt, vl );
+       vsnprintf( buffer+9, sizeof(buffer)-9, fmt, vl );
        buffer[sizeof(buffer)-1] = '\0';
        if( log_file != NULL ) {
                fputs( buffer, log_file );
index d01c70d0675211895bf959df2e04dc3c4a4d3184..4023e18b1496320a9716c5a2faf98568c01dbaae 100644 (file)
@@ -2110,6 +2110,7 @@ accesslog_db_root(
                AttributeDescription *ad = NULL;
                const char *text = NULL;
                Entry *e_ctx;
+               BackendDB db;
 
                e = entry_alloc();
                ber_dupbv( &e->e_name, li->li_db->be_suffix );
@@ -2154,7 +2155,8 @@ accesslog_db_root(
                        }
                        be_entry_release_rw( op, e_ctx, 0 );
                }
-               op->o_bd = li->li_db;
+               db = *li->li_db;
+               op->o_bd = &db;
 
                op->ora_e = e;
                op->o_req_dn = e->e_name;
@@ -2162,7 +2164,6 @@ accesslog_db_root(
                op->o_callback = &nullsc;
                SLAP_DBFLAGS( op->o_bd ) |= SLAP_DBFLAG_NOLASTMOD;
                rc = op->o_bd->be_add( op, &rs );
-               SLAP_DBFLAGS( op->o_bd ) ^= SLAP_DBFLAG_NOLASTMOD;
                if ( e == op->ora_e )
                        entry_free( e );
        }
index af043057dd7e399ba6492325fbc4e555585c3989..61438d5e9ea28b0cd5d6082cf151eaf101f953fb 100755 (executable)
@@ -42,7 +42,7 @@ case "$SYNCMODE" in
                SYNCTYPE="type=refreshOnly interval=00:00:00:03"
                ;;
        rp)
-               SYNCTYPE="type=refreshAndPersist"
+               SYNCTYPE="type=refreshAndPersist interval=00:00:00:03"
                ;;
        *)
                echo "unknown sync mode $SYNCMODE"
@@ -288,8 +288,26 @@ if test $RC != 0 ; then
        exit $RC
 fi
 
-echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
-sleep $SLEEP1
+THEDN="cn=James A Jones 2,ou=Alumni Association,ou=People,dc=example,dc=com"
+sleep 1
+for i in 1 2 3; do
+       $LDAPSEARCH -S "" -b "$THEDN" -H $URI1 \
+               -s base '(objectClass=*)' entryCSN > "${MASTEROUT}.$i" 2>&1
+       RC=$?
+
+       if test $RC = 0 ; then
+               break
+       fi
+
+       if test $RC != 32 ; then
+               echo "ldapsearch failed at slave ($RC)!"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit $RC
+       fi
+
+       echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+       sleep $SLEEP1
+done
 
 n=1
 while [ $n -le $MMR ]; do
@@ -353,7 +371,6 @@ n=`expr $n + 1`
 done
 
 echo "Using ldapmodify to force conflicts between server 1 and 2..."
-THEDN="cn=James A Jones 2,ou=Alumni Association,ou=People,dc=example,dc=com"
 $LDAPMODIFY -D "$MANAGERDN" -H $URI1 -w $PASSWD \
        >> $TESTOUT 2>&1 << EOF
 dn: $THEDN