]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9598 Do not track olcIncomingConnections in lloadd/test007
authorOndřej Kuzník <ondra@mistotebe.net>
Mon, 31 Oct 2022 09:26:12 +0000 (09:26 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 1 Nov 2022 17:03:51 +0000 (17:03 +0000)
Some values we export in cn=monitor are not managed in a single place,
instead, a task exists that gathers a snapshot of the lloadd state and
stores it for monitor consumption. This exposes a race between the test
reading it out and lloadd updating this cached copy. While we still have
to rely on a shell, rather than being intelligent about whether or not
we should emit a readout into search.out or wait and try again (which is
what test004-monitor does), just filter this attribute out.

tests/data/lloadd/test007-monitor.ldif
tests/scripts/lloadd/test007-coherence

index 52c2c966e9c0e4c2c55bc683a3bfae82b6f69c88..eb8deaee21da9f96786e50b4a448d053589cfc04 100644 (file)
@@ -1,7 +1,6 @@
 # with first backend
 dn: cn=Load Balancer,cn=Backends,cn=Monitor
 objectClass: olmBalancer
-olmIncomingConnections: 0
 olmOutgoingConnections: 4
 
 dn: cn=Incoming Connections,cn=Load Balancer,cn=Backends,cn=Monitor
@@ -87,7 +86,6 @@ olmFailedOps: 0
 # second backend and a rejected search, paged search (19 times x 1 entry), pwmod
 dn: cn=Load Balancer,cn=Backends,cn=Monitor
 objectClass: olmBalancer
-olmIncomingConnections: 0
 olmOutgoingConnections: 13
 
 dn: cn=Incoming Connections,cn=Load Balancer,cn=Backends,cn=Monitor
@@ -274,7 +272,6 @@ olmFailedOps: 0
 # two runs of modifies (with and without TXN)
 dn: cn=Load Balancer,cn=Backends,cn=Monitor
 objectClass: olmBalancer
-olmIncomingConnections: 0
 olmOutgoingConnections: 13
 
 dn: cn=Incoming Connections,cn=Load Balancer,cn=Backends,cn=Monitor
index a78d8e7ef245e19a763149b443cb1c308fd42605..b571841d35a78e8c4effe855871956e0e0837530 100755 (executable)
@@ -483,7 +483,10 @@ test $KILLSERVERS != no && kill -HUP $KILLPIDS
 LDIF=$DATADIR/lloadd/test007-monitor.ldif
 
 echo "Filtering ldapsearch results..."
-$LDIFFILTER < $SEARCHOUT > $SEARCHFLT
+# For now, we don't make sure olmIncomingConnections is reflective of current
+# state (=no connections open) since olmIncomingConnections can be != 0 for a
+# second after it's closed
+$LDIFFILTER < $SEARCHOUT | grep -v '^olmIncomingConnections:' > $SEARCHFLT
 echo "Filtering original ldif used to create database..."
 $LDIFFILTER < $LDIF | sed \
     -e "s|@URI2@|$URI2|g" \