[OPENDJ-2357] OpenDJ: debugsearchindex incorrectly returns UNINDEXED when the values exceed the index entry limit. Created: 14/Oct/15  Updated: 08/Nov/19  Resolved: 04/May/16

Status: Done
Project: OpenDJ
Component/s: backends, core server
Affects Version/s: 2.6.3, 2.6.2, 2.6.1, 2.6.0
Fix Version/s: Not applicable

Type: Bug Priority: Major
Reporter: Lee Trujillo Assignee: Chris Ridd
Resolution: Won't Fix Votes: 1
Labels: release-notes

Issue Links:
Relates
relates to OPENDJ-2211 Searches using debugsearchindex retur... Done
is related to OPENDJ-431 Server-side sort control only works o... Done
Dev Assignee: Chris Ridd
Support Ticket IDs:

 Description   

With an equality and substring index (all default) for an attribute and more than the index limits number of values, debugsearchindex can return UNINDEXED when it should return LIMIT-EXCEEDED.

Test:

  • 5000 entries containing a givenName of "Paul".
  • One entry with a givenName of "Paulette".
$ bin/ldapsearch -h localhost -p 1389 -b dc=example,dc=com -s sub "(givenname=Paul)" debugsearchindex
dn: cn=debugsearch
debugsearchindex: filter=(givenName=Paul)[INDEX:givenName.equality][LIMIT-EXCEEDED] scope=wholeSubtree[LIMIT-EXCEEDED:5003] final=[LIMIT-EXCEEDED:5003]

$ bin/ldapsearch -h localhost -p 1389 -b dc=example,dc=com -s sub "(givenname=Paul*)" debugsearchindex
dn: cn=debugsearch
debugsearchindex: filter=(givenName=Paul*)[INDEX:givenName.substring][NOT-INDEXED] scope=wholeSubtree[LIMIT-EXCEEDED:5003] final=[NOT-INDEXED]

$ bin/ldapsearch -h localhost -p 1389 -b dc=example,dc=com -s sub "(givenname=Paule*)" debugsearchindex
dn: cn=debugsearch
debugsearchindex: filter=(givenName=Paule*)[INDEX:givenName.equality][COUNT:1] final=[COUNT:1]

It looks like if one of those keys hits the limit, we incorrectly return UNINDEXED when we should return LIMIT-EXCEEDED.

The code getting called in evaluateSubstringFilter(): is

          EntryIDSet list = matchInitialSubstring(normBytes);
          results.retainAll(list);

The (list) is set to "LIMIT-EXCEEDED", and because retainAll() doesn't update the results's keyBytes field, results.toString() returns "UNINDEXED" after the retainAll(). This code has been refactored in 3.0, and avoids this problem.



 Comments   
Comment by Jean-Noël Rouvignac [ 15/Oct/15 ]

Fixed for OpenDJ3 pluggable backend here: https://stash.forgerock.org/projects/OPENDJ/repos/opendj/commits/1974260538e004dbbb9639acc524a887e24bab51

Comment by Jean-Noël Rouvignac [ 15/Oct/15 ]

DJj3's org.opends.server.backends.pluggable.IndexQueryFactoryImpl.readRange() probably maps back to DJ 2.6's org.opends.server.backends.jeb.Index.readRange().
Lee Trujillo This is the place you have to look at.

Comment by Matthew Swift [ 12/Mar/16 ]

Needs re-evaluating: may be resolved in 3.0.0.

Comment by Matthew Swift [ 07/Nov/19 ]

Moved to closed state because the fixVersion has already been released.

Generated at Sat Oct 31 02:13:07 UTC 2020 using Jira 7.13.12#713012-sha1:6e07c38070d5191bbf7353952ed38f111754533a.