andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
dc8c34
From f645f45bdf3cec252c9e925aa85497bf5dffc2df Mon Sep 17 00:00:00 2001
dc8c34
From: "Thierry bordaz (tbordaz)" <tbordaz@redhat.com>
dc8c34
Date: Fri, 17 May 2013 11:48:08 +0200
dc8c34
Subject: [PATCH 132/225] Ticket 47354 - Indexed search are logged with
dc8c34
 'notes=U' in the access logs
dc8c34
dc8c34
Bug Description:
dc8c34
	In the access log, the flag "notes=U" is present to warn the customer that the provided filter contains not
dc8c34
	indexed components. This flag is set independently of the fact that all entries of the database will be
dc8c34
	evaluated against the filter. So it can not be used to determine if all the entries have been scanned.
dc8c34
	Evaluated all entries is usually a performance hit for large database containing millions of entries.
dc8c34
dc8c34
Fix Description:
dc8c34
	The fix consist to introduce a new flag 'notes=A' at the top level (ldbm_back_search) only when the candidate
dc8c34
	list is ALLID and all entries will be scanned.
dc8c34
	The fix also contains the update of logconv.pl to take into account this change.
dc8c34
dc8c34
https://fedorahosted.org/389/ticket/47354
dc8c34
dc8c34
Reviewed by: Rich Megginson and Mark Reynolds (thanks to you !)
dc8c34
dc8c34
Platforms tested: Fedora 17
dc8c34
dc8c34
Flag Day: no
dc8c34
dc8c34
Doc impact: no
dc8c34
(cherry picked from commit f2b5a975c2268b6e99bf27b45a7380d295807d81)
dc8c34
(cherry picked from commit 15c77ad6e757625cd8a57bb5cde5e8d697bf5b25)
dc8c34
(cherry picked from commit fb1c15d8b89c632e0e45c885334d47b6bbb17730)
dc8c34
(cherry picked from commit 4ef6e16664a036299bc4940fe8fe3441474f233f)
dc8c34
---
dc8c34
 ldap/admin/src/logconv.pl                  | 221 +++++++++++++++++++++++------
dc8c34
 ldap/servers/slapd/back-ldbm/ldbm_search.c |   6 +-
dc8c34
 ldap/servers/slapd/result.c                |   3 +-
dc8c34
 ldap/servers/slapd/slapi-plugin.h          |   1 +
dc8c34
 4 files changed, 187 insertions(+), 44 deletions(-)
dc8c34
dc8c34
diff --git a/ldap/admin/src/logconv.pl b/ldap/admin/src/logconv.pl
dc8c34
index 77088ff..8ae72da 100755
dc8c34
--- a/ldap/admin/src/logconv.pl
dc8c34
+++ b/ldap/admin/src/logconv.pl
dc8c34
@@ -157,8 +157,10 @@ print "\nCommand: logconv.pl @ARGV\n\n";
dc8c34
 
dc8c34
 $rootDNBindCount = 0;
dc8c34
 $anonymousBindCount = 0;
dc8c34
-$unindexedSrchCount = 0;
dc8c34
-$vlvNotesCount= 0;
dc8c34
+$unindexedSrchCountNotesA = 0;
dc8c34
+$unindexedSrchCountNotesU = 0;
dc8c34
+$vlvNotesACount= 0;
dc8c34
+$vlvNotesUCount= 0;
dc8c34
 $srchCount = 0;
dc8c34
 $fdTaken = 0;
dc8c34
 $fdReturned = 0;
dc8c34
@@ -254,11 +256,16 @@ $UNBIND_CONN = "$dataLocation/unbindconn.logconv";
dc8c34
 $UNBIND_OP = "$dataLocation/unbindop.logconv";
dc8c34
 $EXT_CONN = "$dataLocation/extconn.logconv";
dc8c34
 $EXT_OP = "$dataLocation/extop.logconv";
dc8c34
-$NOTES_ETIME = "$dataLocation/notesetime.logconv";
dc8c34
-$NOTES_CONN = "$dataLocation/notesconn.logconv";
dc8c34
-$NOTES_OP = "$dataLocation/notesop.logconv";
dc8c34
-$NOTES_TIME = "$dataLocation/notestime.logconv";
dc8c34
-$NOTES_NENTRIES = "$dataLocation/notesnentries.logconv";
dc8c34
+$NOTES_A_ETIME = "$dataLocation/notesAetime.logconv";
dc8c34
+$NOTES_A_CONN = "$dataLocation/notesAconn.logconv";
dc8c34
+$NOTES_A_OP = "$dataLocation/notesAop.logconv";
dc8c34
+$NOTES_A_TIME = "$dataLocation/notesAtime.logconv";
dc8c34
+$NOTES_A_NENTRIES = "$dataLocation/notesAnentries.logconv";
dc8c34
+$NOTES_U_ETIME = "$dataLocation/notesUetime.logconv";
dc8c34
+$NOTES_U_CONN = "$dataLocation/notesUconn.logconv";
dc8c34
+$NOTES_U_OP = "$dataLocation/notesUop.logconv";
dc8c34
+$NOTES_U_TIME = "$dataLocation/notesUtime.logconv";
dc8c34
+$NOTES_U_NENTRIES = "$dataLocation/notesUnentries.logconv";
dc8c34
 $BADPWDCONN = "$dataLocation/badpwdconn.logconv";
dc8c34
 $BADPWDOP = "$dataLocation/badpwdop.logconv";
dc8c34
 $BADPWDIP = "$dataLocation/badpwdip.logconv";
dc8c34
@@ -641,20 +648,22 @@ print "Abandoned Requests:           $abandonCount\n";
dc8c34
 print "Smart Referrals Received:     $referralCount\n";
dc8c34
 print "\n";
dc8c34
 print "VLV Operations:               $vlvCount\n";
dc8c34
-print "VLV Unindexed Searches:       $vlvNotesCount\n";
dc8c34
+print "VLV Unindexed Searches:       $vlvNotesACount\n";
dc8c34
+print "VLV Unindexed Components:     $vlvNotesUCount\n";
dc8c34
 print "SORT Operations:              $vlvSortCount\n";
dc8c34
 print "\n";
dc8c34
 print "Entire Search Base Queries:   $objectclassTopCount\n";
dc8c34
 print "Paged Searches:               $pagedSearchCount\n";
dc8c34
-print "Unindexed Searches:           $unindexedSrchCount\n";
dc8c34
+print "Unindexed Searches:           $unindexedSrchCountNotesA\n";
dc8c34
+print "Unindexed Components:         $unindexedSrchCountNotesU\n";
dc8c34
 if ($verb eq "yes" || $usage =~ /u/){
dc8c34
-	if ($unindexedSrchCount > 0){
dc8c34
+	if ($unindexedSrchCountNotesA > 0){
dc8c34
 		%conn_hash = getHashFromFile($CONN_HASH);
dc8c34
-		@notesConn = getArrayFromFile($NOTES_CONN);
dc8c34
-		@notesOp = getArrayFromFile($NOTES_OP);
dc8c34
-		@notesEtime = getArrayFromFile($NOTES_ETIME);
dc8c34
-		@notesTime = getArrayFromFile($NOTES_TIME);
dc8c34
-		@notesNentries = getArrayFromFile($NOTES_NENTRIES);
dc8c34
+		@notesConn = getArrayFromFile($NOTES_A_CONN);
dc8c34
+		@notesOp = getArrayFromFile($NOTES_A_OP);
dc8c34
+		@notesEtime = getArrayFromFile($NOTES_A_ETIME);
dc8c34
+		@notesTime = getArrayFromFile($NOTES_A_TIME);
dc8c34
+		@notesNentries = getArrayFromFile($NOTES_A_NENTRIES);
dc8c34
 		getInfoArraysFromFile($BASEINFO);
dc8c34
 		@base_val = @fileArray1;
dc8c34
 		@base_conn = @fileArray2;
dc8c34
@@ -720,6 +729,78 @@ if ($verb eq "yes" || $usage =~ /u/){
dc8c34
 		undef @scope_conn;
dc8c34
 		undef @scope_op;	
dc8c34
 	}
dc8c34
+	if ($unindexedSrchCountNotesU > 0){
dc8c34
+		%conn_hash = getHashFromFile($CONN_HASH);
dc8c34
+		@notesConn = getArrayFromFile($NOTES_U_CONN);
dc8c34
+		@notesOp = getArrayFromFile($NOTES_U_OP);
dc8c34
+		@notesEtime = getArrayFromFile($NOTES_U_ETIME);
dc8c34
+		@notesTime = getArrayFromFile($NOTES_U_TIME);
dc8c34
+		@notesNentries = getArrayFromFile($NOTES_U_NENTRIES);
dc8c34
+		getInfoArraysFromFile($BASEINFO);
dc8c34
+		@base_val = @fileArray1;
dc8c34
+		@base_conn = @fileArray2;
dc8c34
+		@base_op = @fileArray3;
dc8c34
+		getInfoArraysFromFile($SCOPEINFO);
dc8c34
+		@scope_val = @fileArray1;
dc8c34
+		@scope_conn = @fileArray2;
dc8c34
+		@scope_op = @fileArray3;
dc8c34
+		getInfoArraysFromFile($FILTERINFO);
dc8c34
+		@filter_val = @fileArray1;
dc8c34
+		@filter_conn = @fileArray2;
dc8c34
+		@filter_op = @fileArray3;
dc8c34
+
dc8c34
+		$notesCount = "1";
dc8c34
+		for ($n = 0; $n <= $#notesEtime; $n++){
dc8c34
+			@alreadyseenDN = ();
dc8c34
+			if($conn_hash{$notesConn[$n]} eq ""){
dc8c34
+				$unindexedIp = "?";
dc8c34
+			} else {
dc8c34
+				$unindexedIp = $conn_hash{$notesConn[$n]};
dc8c34
+			}
dc8c34
+			print "\n  Unindexed Components #".$notesCount."\n"; $notesCount++;
dc8c34
+			print "  -  Date/Time:             $notesTime[$n]\n";
dc8c34
+			print "  -  Connection Number:     $notesConn[$n]\n";
dc8c34
+			print "  -  Operation Number:      $notesOp[$n]\n";
dc8c34
+			print "  -  Etime:                 $notesEtime[$n]\n";
dc8c34
+			print "  -  Nentries:              $notesNentries[$n]\n";
dc8c34
+			print "  -  IP Address:            $unindexedIp\n";
dc8c34
+
dc8c34
+			for ($nnn = 0; $nnn < $baseCount; $nnn++){
dc8c34
+				if ($notesConn[$n] eq $base_conn[$nnn] && $notesOp[$n] eq $base_op[$nnn]){
dc8c34
+					print "  -  Search Base:           $base_val[$nnn]\n";
dc8c34
+					last;
dc8c34
+				}
dc8c34
+			}
dc8c34
+			for ($nnn = 0; $nnn < $scopeCount; $nnn++){
dc8c34
+				if ($notesConn[$n] eq $scope_conn[$nnn] && $notesOp[$n] eq $scope_op[$nnn]){
dc8c34
+					print "  -  Search Scope:          $scope_val[$nnn]\n";
dc8c34
+					last;
dc8c34
+				}
dc8c34
+			}
dc8c34
+			for ($nnn = 0; $nnn < $filterCount; $nnn++){	
dc8c34
+				if ($notesConn[$n] eq $filter_conn[$nnn] && $notesOp[$n] eq $filter_op[$nnn]){
dc8c34
+					print "  -  Search Filter:         $filter_val[$nnn]\n";
dc8c34
+					last;
dc8c34
+				}	
dc8c34
+			}
dc8c34
+		}
dc8c34
+		undef %conn_hash;
dc8c34
+		undef @notesConn;
dc8c34
+		undef @notesOp;
dc8c34
+		undef @notesEtime;
dc8c34
+		undef @notesTime;
dc8c34
+		undef @notesNentries;
dc8c34
+		undef @notesIp;
dc8c34
+		undef @filter_val;
dc8c34
+		undef @filter_conn;
dc8c34
+		undef @filter_op;
dc8c34
+		undef @base_val;
dc8c34
+		undef @base_conn;
dc8c34
+		undef @base_op;
dc8c34
+		undef @scope_val;
dc8c34
+		undef @scope_conn;
dc8c34
+		undef @scope_op;	
dc8c34
+	}
dc8c34
 } # end of unindexed search report
dc8c34
 
dc8c34
 print "\n";
dc8c34
@@ -1276,10 +1357,14 @@ if ($usage =~ /j/i || $verb eq "yes"){
dc8c34
 	%conncount = getCounterHashFromFile($CONNCOUNT);
dc8c34
 	print "\n----- Recommendations -----\n";
dc8c34
 	$recCount = "1";
dc8c34
-	if ($unindexedSrchCount > 0){
dc8c34
+	if ($unindexedSrchCountNotesA > 0){
dc8c34
 		print "\n $recCount.  You have unindexed searches, this can be caused from a search on an unindexed attribute, or your returned results exceeded the allidsthreshold.  Unindexed searches are not recommended. To refuse unindexed searches, switch \'nsslapd-require-index\' to \'on\' under your database entry (e.g. cn=UserRoot,cn=ldbm database,cn=plugins,cn=config).\n";
dc8c34
 		$recCount++;
dc8c34
 	}
dc8c34
+	if ($unindexedSrchCountNotesU > 0){
dc8c34
+		print "\n $recCount.  You have unindexed components, this can be caused from a search on an unindexed attribute, or your returned results exceeded the allidsthreshold.  Unindexed components are not recommended. To refuse unindexed searches, switch \'nsslapd-require-index\' to \'on\' under your database entry (e.g. cn=UserRoot,cn=ldbm database,cn=plugins,cn=config).\n";
dc8c34
+		$recCount++;
dc8c34
+	}
dc8c34
 	if ($conncount{"T1"} > 0){
dc8c34
 		print "\n $recCount.  You have some connections that are are being closed by the idletimeout setting. You may want to increase the idletimeout if it is set low.\n";
dc8c34
 		$recCount++;
dc8c34
@@ -1773,36 +1858,71 @@ sub parseLineNormal
dc8c34
 	if (m/ RESULT err=/ && m/ notes=P/){
dc8c34
 		$pagedSearchCount++;
dc8c34
 	}
dc8c34
+	if (m/ notes=A/){
dc8c34
+		if ($_ =~ /conn= *([0-9]+)/i){
dc8c34
+		        $con = $1;
dc8c34
+		        if ($_ =~ /op= *([0-9]+)/i){ $op = $1;}
dc8c34
+		}
dc8c34
+		for ($i=0; $i <= $vlvCount;$i++){
dc8c34
+		        if ($vlvconn[$i] eq $con && $vlvop[$i] eq $op){ $vlvNotesACount++; $isVlvNotes="1";}
dc8c34
+		}
dc8c34
+		if($isVlvNotes == 0){
dc8c34
+			#  We don't want to record vlv unindexed searches for our regular "bad" 
dc8c34
+			#  unindexed search stat, as VLV unindexed searches aren't that bad
dc8c34
+			$unindexedSrchCountNotesA++;
dc8c34
+			if($reportStats){ inc_stats('notesA',$s_stats,$m_stats); }
dc8c34
+		}
dc8c34
+		if ($usage =~ /u/ || $verb eq "yes"){
dc8c34
+			if ($isVlvNnotes == 0 ){
dc8c34
+		        	if ($_ =~ /etime= *([0-9.]+)/i ){
dc8c34
+		                	writeFile($NOTES_A_ETIME, $1);
dc8c34
+		        	}
dc8c34
+		        	if ($_ =~ /conn= *([0-9]+)/i){
dc8c34
+		                	writeFile($NOTES_A_CONN, $1);
dc8c34
+		        	}
dc8c34
+		        	if ($_ =~ /op= *([0-9]+)/i){
dc8c34
+		                	writeFile($NOTES_A_OP, $1);
dc8c34
+		        	}
dc8c34
+		        	if ($_ =~ / *([0-9a-z:\/]+)/i){
dc8c34
+		                	writeFile($NOTES_A_TIME, $1);
dc8c34
+		        	}
dc8c34
+				if ($_ =~ /nentries= *([0-9]+)/i ){
dc8c34
+					writeFile($NOTES_A_NENTRIES, $1);
dc8c34
+				}
dc8c34
+			}
dc8c34
+		}
dc8c34
+		$isVlvNotes = 0;
dc8c34
+	}
dc8c34
 	if (m/ notes=U/){
dc8c34
 		if ($_ =~ /conn= *([0-9]+)/i){
dc8c34
 		        $con = $1;
dc8c34
 		        if ($_ =~ /op= *([0-9]+)/i){ $op = $1;}
dc8c34
 		}
dc8c34
 		for ($i=0; $i <= $vlvCount;$i++){
dc8c34
-		        if ($vlvconn[$i] eq $con && $vlvop[$i] eq $op){ $vlvNotesCount++; $isVlvNotes="1";}
dc8c34
+		        if ($vlvconn[$i] eq $con && $vlvop[$i] eq $op){ $vlvNotesUCount++; $isVlvNotes="1";}
dc8c34
 		}
dc8c34
 		if($isVlvNotes == 0){
dc8c34
 			#  We don't want to record vlv unindexed searches for our regular "bad" 
dc8c34
 			#  unindexed search stat, as VLV unindexed searches aren't that bad
dc8c34
-			$unindexedSrchCount++;
dc8c34
-			if($reportStats){ inc_stats('notesu',$s_stats,$m_stats); }
dc8c34
+			$unindexedSrchCountNotesU++;
dc8c34
+			if($reportStats){ inc_stats('notesU',$s_stats,$m_stats); }
dc8c34
 		}
dc8c34
 		if ($usage =~ /u/ || $verb eq "yes"){
dc8c34
 			if ($isVlvNnotes == 0 ){
dc8c34
 		        	if ($_ =~ /etime= *([0-9.]+)/i ){
dc8c34
-		                	writeFile($NOTES_ETIME, $1);
dc8c34
+		                	writeFile($NOTES_U_ETIME, $1);
dc8c34
 		        	}
dc8c34
 		        	if ($_ =~ /conn= *([0-9]+)/i){
dc8c34
-		                	writeFile($NOTES_CONN, $1);
dc8c34
+		                	writeFile($NOTES_U_CONN, $1);
dc8c34
 		        	}
dc8c34
 		        	if ($_ =~ /op= *([0-9]+)/i){
dc8c34
-		                	writeFile($NOTES_OP, $1);
dc8c34
+		                	writeFile($NOTES_U_OP, $1);
dc8c34
 		        	}
dc8c34
 		        	if ($_ =~ / *([0-9a-z:\/]+)/i){
dc8c34
-		                	writeFile($NOTES_TIME, $1);
dc8c34
+		                	writeFile($NOTES_U_TIME, $1);
dc8c34
 		        	}
dc8c34
 				if ($_ =~ /nentries= *([0-9]+)/i ){
dc8c34
-					writeFile($NOTES_NENTRIES, $1);
dc8c34
+					writeFile($NOTES_U_NENTRIES, $1);
dc8c34
 				}
dc8c34
 			}
dc8c34
 		}
dc8c34
@@ -2196,7 +2316,8 @@ reset_stats_block
dc8c34
     $stats->{'bind'}=0;
dc8c34
     $stats->{'anonbind'}=0;
dc8c34
     $stats->{'unbind'}=0;
dc8c34
-    $stats->{'notesu'}=0;
dc8c34
+    $stats->{'notesA'}=0;
dc8c34
+    $stats->{'notesU'}=0;
dc8c34
     $stats->{'etime'}=0;
dc8c34
     return;
dc8c34
 }
dc8c34
@@ -2242,13 +2363,14 @@ print_stats_block
dc8c34
 					    $stats->{'bind'},
dc8c34
 					    $stats->{'anonbind'},
dc8c34
 					    $stats->{'unbind'},
dc8c34
-					    $stats->{'notesu'},
dc8c34
+					    $stats->{'notesA'},
dc8c34
+					    $stats->{'notesU'},
dc8c34
 					    $stats->{'etime'}),
dc8c34
 			    		"\n" );
dc8c34
 			} else {
dc8c34
 				$stats->{'fh'}->print(
dc8c34
 			    		"Time,time_t,Results,Search,Add,Mod,Modrdn,Moddn,Compare,Delete,Abandon,".
dc8c34
-			    		"Connections,SSL Conns,Bind,Anon Bind,Unbind,Unindexed,ElapsedTime\n"
dc8c34
+			    		"Connections,SSL Conns,Bind,Anon Bind,Unbind,Unindexed search,Unindexed component,ElapsedTime\n"
dc8c34
 			    	);
dc8c34
 			}
dc8c34
 		}
dc8c34
@@ -2415,11 +2537,16 @@ openDataFiles
dc8c34
 	open($UNBIND_OP, ">$UNBIND_OP") or do { openFailed($!, $UNBIND_OP) };
dc8c34
 	open($EXT_CONN, ">$EXT_CONN") or do { openFailed($!, $EXT_CONN) };
dc8c34
 	open($EXT_OP, ">$EXT_OP") or do { openFailed($!, $EXT_OP) };
dc8c34
-	open($NOTES_ETIME, ">$NOTES_ETIME") or do { openFailed($!, $NOTES_ETIME) };
dc8c34
-	open($NOTES_CONN, ">$NOTES_CONN") or do { openFailed($!, $NOTES_CONN) };
dc8c34
-	open($NOTES_OP, ">$NOTES_OP") or do { openFailed($!, $NOTES_OP) };
dc8c34
-	open($NOTES_TIME, ">$NOTES_TIME") or do { openFailed($!, $NOTES_TIME) };
dc8c34
-	open($NOTES_NENTRIES, ">$NOTES_NENTRIES") or do { openFailed($!, $NOTES_NENTRIES) };
dc8c34
+	open($NOTES_A_ETIME, ">$NOTES_A_ETIME") or do { openFailed($!, $NOTES_A_ETIME) };
dc8c34
+	open($NOTES_A_CONN, ">$NOTES_A_CONN") or do { openFailed($!, $NOTES_A_CONN) };
dc8c34
+	open($NOTES_A_OP, ">$NOTES_A_OP") or do { openFailed($!, $NOTES_A_OP) };
dc8c34
+	open($NOTES_A_TIME, ">$NOTES_A_TIME") or do { openFailed($!, $NOTES_A_TIME) };
dc8c34
+	open($NOTES_A_NENTRIES, ">$NOTES_A_NENTRIES") or do { openFailed($!, $NOTES_A_NENTRIES) };
dc8c34
+	open($NOTES_U_ETIME, ">$NOTES_U_ETIME") or do { openFailed($!, $NOTES_U_ETIME) };
dc8c34
+	open($NOTES_U_CONN, ">$NOTES_U_CONN") or do { openFailed($!, $NOTES_U_CONN) };
dc8c34
+	open($NOTES_U_OP, ">$NOTES_U_OP") or do { openFailed($!, $NOTES_U_OP) };
dc8c34
+	open($NOTES_U_TIME, ">$NOTES_U_TIME") or do { openFailed($!, $NOTES_U_TIME) };
dc8c34
+	open($NOTES_U_NENTRIES, ">$NOTES_U_NENTRIES") or do { openFailed($!, $NOTES_U_NENTRIES) };
dc8c34
 	open($BADPWDCONN, ">$BADPWDCONN")  or do { openFailed($!, $BADPWDCONN) };
dc8c34
 	open($BADPWDOP, ">$BADPWDOP")  or do { openFailed($!, $BADPWDOP) };
dc8c34
 	open($BADPWDIP, ">$BADPWDIP")  or do { openFailed($!, $NADPWDIP) };
dc8c34
@@ -2473,11 +2600,16 @@ closeDataFiles
dc8c34
 	close $UNBIND_OP;
dc8c34
 	close $EXT_CONN;
dc8c34
 	close $EXT_OP;
dc8c34
-	close $NOTES_ETIME;
dc8c34
-	close $NOTES_CONN;
dc8c34
-	close $NOTES_OP;
dc8c34
-	close $NOTES_TIME;
dc8c34
-	close $NOTES_NENTRIES;
dc8c34
+	close $NOTES_A_ETIME;
dc8c34
+	close $NOTES_A_CONN;
dc8c34
+	close $NOTES_A_OP;
dc8c34
+	close $NOTES_A_TIME;
dc8c34
+	close $NOTES_A_NENTRIES;
dc8c34
+	close $NOTES_U_ETIME;
dc8c34
+	close $NOTES_U_CONN;
dc8c34
+	close $NOTES_U_OP;
dc8c34
+	close $NOTES_U_TIME;
dc8c34
+	close $NOTES_U_NENTRIES;
dc8c34
 	close $BADPWDCONN;
dc8c34
 	close $BADPWDOP;
dc8c34
 	close $BADPWDIP;
dc8c34
@@ -2531,11 +2663,16 @@ removeDataFiles
dc8c34
 	unlink $UNBIND_OP;
dc8c34
 	unlink $EXT_CONN;
dc8c34
 	unlink $EXT_OP;
dc8c34
-	unlink $NOTES_ETIME;
dc8c34
-	unlink $NOTES_CONN;
dc8c34
-	unlink $NOTES_OP;
dc8c34
-	unlink $NOTES_TIME;
dc8c34
-	unlink $NOTES_NENTRIES;
dc8c34
+	unlink $NOTES_A_ETIME;
dc8c34
+	unlink $NOTES_A_CONN;
dc8c34
+	unlink $NOTES_A_OP;
dc8c34
+	unlink $NOTES_A_TIME;
dc8c34
+	unlink $NOTES_A_NENTRIES;
dc8c34
+	unlink $NOTES_U_ETIME;
dc8c34
+	unlink $NOTES_U_CONN;
dc8c34
+	unlink $NOTES_U_OP;
dc8c34
+	unlink $NOTES_U_TIME;
dc8c34
+	unlink $NOTES_U_NENTRIES;
dc8c34
 	unlink $BADPWDCONN;
dc8c34
 	unlink $BADPWDOP;
dc8c34
 	unlink $BADPWDIP;
dc8c34
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_search.c b/ldap/servers/slapd/back-ldbm/ldbm_search.c
dc8c34
index e68b897..d092b2e 100644
dc8c34
--- a/ldap/servers/slapd/back-ldbm/ldbm_search.c
dc8c34
+++ b/ldap/servers/slapd/back-ldbm/ldbm_search.c
dc8c34
@@ -824,7 +824,7 @@ ldbm_back_search( Slapi_PBlock *pb )
dc8c34
      * to record that fact.
dc8c34
      */
dc8c34
     if ( NULL != candidates && ALLIDS( candidates )) {
dc8c34
-        unsigned int opnote = SLAPI_OP_NOTE_UNINDEXED;
dc8c34
+        unsigned int opnote;
dc8c34
         int ri = 0;
dc8c34
         int pr_idx = -1;
dc8c34
 
dc8c34
@@ -847,6 +847,10 @@ ldbm_back_search( Slapi_PBlock *pb )
dc8c34
             }
dc8c34
         }
dc8c34
 
dc8c34
+        slapi_pblock_get( pb, SLAPI_OPERATION_NOTES, &opnote );
dc8c34
+        opnote |= SLAPI_OP_NOTE_FULL_UNINDEXED; /* the full filter leads to an unindexed search */
dc8c34
+        opnote &= ~SLAPI_OP_NOTE_UNINDEXED;     /* this note is useless because FULL_UNINDEXED includes UNINDEXED */
dc8c34
+        slapi_pblock_set( pb, SLAPI_OPERATION_NOTES, NULL );
dc8c34
         slapi_pblock_set( pb, SLAPI_OPERATION_NOTES, &opnote );
dc8c34
         slapi_pblock_get( pb, SLAPI_PAGED_RESULTS_INDEX, &pr_idx );
dc8c34
         pagedresults_set_unindexed( pb->pb_conn, pb->pb_op, pr_idx );
dc8c34
diff --git a/ldap/servers/slapd/result.c b/ldap/servers/slapd/result.c
dc8c34
index 09d6b90..5463592 100644
dc8c34
--- a/ldap/servers/slapd/result.c
dc8c34
+++ b/ldap/servers/slapd/result.c
dc8c34
@@ -1618,7 +1618,8 @@ struct slapi_note_map {
dc8c34
 
dc8c34
 static struct slapi_note_map notemap[] = {
dc8c34
 	{ SLAPI_OP_NOTE_UNINDEXED,   "U" },
dc8c34
-	{ SLAPI_OP_NOTE_SIMPLEPAGED, "P" }
dc8c34
+	{ SLAPI_OP_NOTE_SIMPLEPAGED, "P" },
dc8c34
+        { SLAPI_OP_NOTE_FULL_UNINDEXED, "A" }
dc8c34
 };
dc8c34
 
dc8c34
 #define SLAPI_NOTEMAP_COUNT  ( sizeof(notemap) / sizeof(struct slapi_note_map))
dc8c34
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
dc8c34
index 0fdb206..642f515 100644
dc8c34
--- a/ldap/servers/slapd/slapi-plugin.h
dc8c34
+++ b/ldap/servers/slapd/slapi-plugin.h
dc8c34
@@ -6593,6 +6593,7 @@ typedef struct slapi_plugindesc {
dc8c34
 #define SLAPI_OPERATION_NOTES			57
dc8c34
 #define SLAPI_OP_NOTE_UNINDEXED		0x01
dc8c34
 #define SLAPI_OP_NOTE_SIMPLEPAGED	0x02
dc8c34
+#define SLAPI_OP_NOTE_FULL_UNINDEXED    0x04
dc8c34
 
dc8c34
 /* Allows controls to be passed before operation object is created */
dc8c34
 #define SLAPI_CONTROLS_ARG			58
dc8c34
-- 
dc8c34
1.8.1.4
dc8c34