Issue 7796 - LDAP_DEBUG_TRACE for "not indexed" log messages
Summary: LDAP_DEBUG_TRACE for "not indexed" log messages
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: 2.5.0
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-06 12:32 UTC by Michael Ströder
Modified: 2020-10-14 21:04 UTC (History)
0 users

See Also:


Attachments
openldap-master-its7796.patch (2.59 KB, patch)
2014-02-06 12:38 UTC, Michael Ströder
Details

Note You need to log in before you can comment on or make changes to this issue.
Description Michael Ströder 2014-02-06 12:32:05 UTC
Full_Name: 
Version: HEAD and RE24
OS: 
URL: 
Submission from: (NULL) (212.227.35.93)


Especially when using set-based ACLs the amount of "not indexed" messages is
really annoying even when only "loglevel stats" is used.

Since those messages are useless even for beginners the log-level should be
changed to LDAP_DEBUG_TRACE instead of LDAP_DEBUG_ANY.
Comment 1 Michael Ströder 2014-02-06 12:38:10 UTC
I, Michael Ströder, hereby place the attached modifications to OpenLDAP
Software (and only these modifications) into the public domain. Hence, these
modifications may be freely used and/or redistributed for any purpose with or
without attribution and/or other notice.

Comment 2 Michael Ströder 2014-02-06 18:40:18 UTC
I, Michael Ströder, hereby place the attached modifications to OpenLDAP
Software (and only these modifications) into the public domain. Hence, these
modifications may be freely used and/or redistributed for any purpose with or
without attribution and/or other notice.

Resent as readable ASCII diff for ITS.

diff --git a/servers/slapd/back-bdb/filterindex.c
b/servers/slapd/back-bdb/filterindex.c
index 71e3ea4..bafef72 100644
--- a/servers/slapd/back-bdb/filterindex.c
+++ b/servers/slapd/back-bdb/filterindex.c
@@ -741,7 +741,7 @@ equality_candidates(
 		&db, &mask, &prefix );

 	if ( rc == LDAP_INAPPROPRIATE_MATCHING ) {
-		Debug( LDAP_DEBUG_ANY,
+		Debug( LDAP_DEBUG_TRACE,
 			"<= bdb_equality_candidates: (%s) not indexed\n",
 			ava->aa_desc->ad_cname.bv_val, 0, 0 );
 		return 0;
@@ -858,7 +858,7 @@ approx_candidates(
 		&db, &mask, &prefix );

 	if ( rc == LDAP_INAPPROPRIATE_MATCHING ) {
-		Debug( LDAP_DEBUG_ANY,
+		Debug( LDAP_DEBUG_TRACE,
 			"<= bdb_approx_candidates: (%s) not indexed\n",
 			ava->aa_desc->ad_cname.bv_val, 0, 0 );
 		return 0;
@@ -978,7 +978,7 @@ substring_candidates(
 		&db, &mask, &prefix );

 	if ( rc == LDAP_INAPPROPRIATE_MATCHING ) {
-		Debug( LDAP_DEBUG_ANY,
+		Debug( LDAP_DEBUG_TRACE,
 			"<= bdb_substring_candidates: (%s) not indexed\n",
 			sub->sa_desc->ad_cname.bv_val, 0, 0 );
 		return 0;
@@ -1095,7 +1095,7 @@ inequality_candidates(
 		&db, &mask, &prefix );

 	if ( rc == LDAP_INAPPROPRIATE_MATCHING ) {
-		Debug( LDAP_DEBUG_ANY,
+		Debug( LDAP_DEBUG_TRACE,
 			"<= bdb_inequality_candidates: (%s) not indexed\n",
 			ava->aa_desc->ad_cname.bv_val, 0, 0 );
 		return 0;
diff --git a/servers/slapd/back-mdb/filterindex.c
b/servers/slapd/back-mdb/filterindex.c
index 58c1cc8..20c58b7 100644
--- a/servers/slapd/back-mdb/filterindex.c
+++ b/servers/slapd/back-mdb/filterindex.c
@@ -709,7 +709,7 @@ equality_candidates(
 		&dbi, &mask, &prefix );

 	if ( rc == LDAP_INAPPROPRIATE_MATCHING ) {
-		Debug( LDAP_DEBUG_ANY,
+		Debug( LDAP_DEBUG_TRACE,
 			"<= mdb_equality_candidates: (%s) not indexed\n",
 			ava->aa_desc->ad_cname.bv_val, 0, 0 );
 		return 0;
@@ -825,7 +825,7 @@ approx_candidates(
 		&dbi, &mask, &prefix );

 	if ( rc == LDAP_INAPPROPRIATE_MATCHING ) {
-		Debug( LDAP_DEBUG_ANY,
+		Debug( LDAP_DEBUG_TRACE,
 			"<= mdb_approx_candidates: (%s) not indexed\n",
 			ava->aa_desc->ad_cname.bv_val, 0, 0 );
 		return 0;
@@ -944,7 +944,7 @@ substring_candidates(
 		&dbi, &mask, &prefix );

 	if ( rc == LDAP_INAPPROPRIATE_MATCHING ) {
-		Debug( LDAP_DEBUG_ANY,
+		Debug( LDAP_DEBUG_TRACE,
 			"<= mdb_substring_candidates: (%s) not indexed\n",
 			sub->sa_desc->ad_cname.bv_val, 0, 0 );
 		return 0;
@@ -1060,7 +1060,7 @@ inequality_candidates(
 		&dbi, &mask, &prefix );

 	if ( rc == LDAP_INAPPROPRIATE_MATCHING ) {
-		Debug( LDAP_DEBUG_ANY,
+		Debug( LDAP_DEBUG_TRACE,
 			"<= mdb_inequality_candidates: (%s) not indexed\n",
 			ava->aa_desc->ad_cname.bv_val, 0, 0 );
 		return 0;


Comment 3 Howard Chu 2014-03-09 00:18:14 UTC
I'd consider instead, resurrecting the LDAP_DEBUG_INDEX debug flag, or putting 
these in LDAP_DEBUG_FILTER. TRACE is already too verbose.

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Comment 4 Michael Ströder 2014-03-09 09:52:03 UTC
hyc@symas.com wrote:
> I'd consider instead, resurrecting the LDAP_DEBUG_INDEX debug flag, or putting 
> these in LDAP_DEBUG_FILTER. TRACE is already too verbose.

I'm fine with any solution which avoids that these messages are sent to the
log in case of "loglevel stats stats2".

Ciao, Michael.

Comment 5 Christian Kratzer 2014-03-09 10:05:05 UTC
Hi,

On Sun, 9 Mar 2014, michael@stroeder.com wrote:

> hyc@symas.com wrote:
>> I'd consider instead, resurrecting the LDAP_DEBUG_INDEX debug flag, or putting
>> these in LDAP_DEBUG_FILTER. TRACE is already too verbose.
>
> I'm fine with any solution which avoids that these messages are sent to the
> log in case of "loglevel stats stats2".

I would also welcome a separate loglevel for these daemon messages:

   Mar  9 11:00:24 ldap1 slapd[19539]: daemon: read activity on 9
   Mar  9 11:00:24 ldap1 slapd[19539]: daemon: select: listen=6 active_threads=0 tvp=zero
   Mar  9 11:00:24 ldap1 slapd[19539]: daemon: select: listen=7 active_threads=0 tvp=zero
   Mar  9 11:00:24 ldap1 slapd[19539]: daemon: activity on 1 descriptor
   Mar  9 11:00:24 ldap1 slapd[19539]: daemon: waked
   Mar  9 11:00:24 ldap1 slapd[19539]: daemon: select: listen=6 active_threads=0 tvp=zero
   Mar  9 11:00:24 ldap1 slapd[19539]: daemon: select: listen=7 active_threads=0 tvp=zero

They currently seem to be triggered by loglevel conns.

So what about adding loglevel daemon or even conns2 for these.

Greetings
Christian

-- 
Christian Kratzer                   CK Software GmbH
Email:   ck@cksoft.de               Wildberger Weg 24/2
Phone:   +49 7032 893 997 - 0       D-71126 Gaeufelden
Fax:     +49 7032 893 997 - 9       HRB 245288, Amtsgericht Stuttgart
Mobile:  +49 171 1947 843           Geschaeftsfuehrer: Christian Kratzer
Web:     http://www.cksoft.de/

Comment 6 Michael Ströder 2015-02-22 16:05:00 UTC
Could you please add this patch to RE24?

The amount of unneeded log messages in my setup with lots of ACLs using
non-indexed filters is huge and I hate to maintain local build patches.

Ciao, Michael.

Comment 7 Quanah Gibson-Mount 2020-03-20 18:31:17 UTC
Needs review, may be unnecessary with logging rewrite work?
Comment 8 Michael Ströder 2020-03-20 20:27:49 UTC
I'm using this trivial modification as back-port patch in my own package builds.
Comment 9 Quanah Gibson-Mount 2020-03-20 21:28:41 UTC
(In reply to Michael Ströder from comment #8)
> I'm using this trivial modification as back-port patch in my own package
> builds.

Sure, but if we completely overhaul how logging is handled, then it's not clear to me exactly where this falls in what needs to be done. ;)
Comment 10 Ondřej Kuzník 2020-06-11 11:24:07 UTC
I guess it's more specific to the filter loglevel so changed accordingly. Part of merge request https://git.openldap.org/openldap/openldap/-/merge_requests/80
Comment 11 Quanah Gibson-Mount 2020-06-22 17:32:01 UTC
  • 79960723 
by Ondřej Kuzník at 2020-06-22T09:28:26+01:00 
ITS#7796 Move 'not indexed' messages to loglevel filter