How To
ForgeRock Identity Platform
Does not apply to Identity Cloud

How do I verify indexes in DS (All versions) are correct?

Last updated Jun 15, 2021

The purpose of this article is to provide some guidance on checking DS indexes are correct.


1 reader recommends this article

Overview

Indexes in DS can be incorrect in two different ways:

  1. An index contains a key that refers to an entry that no longer exists or no longer contains the indexed value.
  2. An index should contain a reference to an entry for a particular key, but does not.

Both cases should not occur in general usage.

To detect the errors, the verify-index tool is provided with DS. It needs to be run with different options to detect both kinds of index problems. You must stop the server before verifying indexes.

Note

For an attribute index, the index name is simply an attribute name. Multiple indexes may be verified for completeness or all indexes if no index name is specified.

Index Verification

Verify Case 1

Run the following verify-index command to step through all the entries in the backend and verify that all indexes are correct:

$ ./verify-index --baseDN [baseDN] --countErrors

replacing [baseDN] with appropriate values.

Verify Case 2

Run the following verify-index command to step through all the keys in the index and verify the values for each key correctly match entries in the backend:

$ ./verify-index --baseDN [baseDN] --index [indexname] --clean

replacing [baseDN] and [indexname] with appropriate values.

Verify Case 3

Run the following verify-index command to step through all the entries in the backend and verify that each entry is referenced in the index if appropriate:

$ ./verify-index --baseDN [baseDN] --index [indexname]

replacing [baseDN] and [indexname] with appropriate values.

Example

The objectClass index on this DS server is completely valid:

$ ./verify-index --baseDN "dc=example,dc=com" --countErrors [20/11/2019:10:35:54 -0700] category=BACKEND seq=1 severity=FINE msg=JE backend 'exampleBackend' does not specify the number of cleaner threads: defaulting to 8 threads [20/11/2019:10:35:54 -0700] category=BACKEND seq=2 severity=FINE msg=JE backend 'exampleBackend' does not specify the number of lock tables: defaulting to 17 [20/11/2019:10:35:57 -0700] category=BACKEND seq=35 severity=INFO msg=Checked 10002 entries and found 0 error(s) in 2 seconds (average rate 3965.9/sec) [20/11/2019:10:35:57 -0700] category=BACKEND seq=36 severity=FINE msg=Statistics for records that have exceeded the entry limit: [20/11/2019:10:35:57 -0700] category=BACKEND seq=37 severity=FINE msg=File /dc=com,dc=example/mail.caseIgnoreIA5SubstringsMatch:6 has 15 such record(s) min=10000 max=10000 median=10000 [20/11/2019:10:35:57 -0700] category=BACKEND seq=38 severity=FINE msg=File /dc=com,dc=example/objectClass.objectIdentifierMatch has 4 such record(s) min=10000 max=10002 median=10000 $ ./verify-index --baseDN "dc=example,dc=com" --index objectClass --clean [20/Oct/2019:11:44:42 +0100] category=BACKEND severity=INFORMATION msgID=9437595 msg=Local DB backend exampleBackend does not specify the number of lock tables: defaulting to 97 [20/Oct/2019:11:44:42 +0100] category=BACKEND severity=INFORMATION msgID=9437594 msg=Local DB backend exampleBackend does not specify the number of cleaner threads: defaulting to 24 threads [20/Oct/2019:11:44:42 +0100] category=JEB severity=NOTICE msgID=8847461 msg=Checked 6 records and found 0 error(s) in 0 seconds (average rate 200.0/sec) [20/Oct/2019:11:44:42 +0100] category=JEB severity=INFORMATION msgID=8388710 msg=Number of records referencing more than one entry: 4 [20/Oct/2019:11:44:42 +0100] category=JEB severity=INFORMATION msgID=8388711 msg=Number of records that exceed the entry limit: 4 [20/Oct/2019:11:44:42 +0100] category=JEB severity=INFORMATION msgID=8388712 msg=Average number of entries referenced is 0.33/record [20/Oct/2019:11:44:42 +0100] category=JEB severity=INFORMATION msgID=8388713 msg=Maximum number of entries referenced by any record is 1 $ ./verify-index --baseDN "dc=example,dc=com" --index objectClass [20/Oct/2019:11:43:07 +0100] category=BACKEND severity=INFORMATION msgID=9437595 msg=Local DB backend exampleBackend does not specify the number of lock tables: defaulting to 97 [20/Oct/2019:11:43:07 +0100] category=BACKEND severity=INFORMATION msgID=9437594 msg=Local DB backend exampleBackend does not specify the number of cleaner threads: defaulting to 24 threads [20/Oct/2019:11:43:09 +0100] category=JEB severity=NOTICE msgID=8847466 msg=Checked 20002 entries and found 0 error(s) in 1 seconds (average rate 11984.4/sec) [20/Oct/2019:11:43:09 +0100] category=JEB severity=INFORMATION msgID=8388715 msg=Statistics for records that have exceeded the entry limit: [20/Oct/2019:14:11:43:09 +0100] category=JEB severity=INFORMATION msgID=8388716 msg=File dc_example_dc_com_objectClass.equality has 4 such record(s) min=20000 max=20002 median=20000

See Also

How do I rebuild indexes in DS (All versions)?

Unindexed searches causing slow searches and poor performance on DS (All versions) server

How do I troubleshoot issues with my indexes in DS (All versions)?

How do I know what index types are needed for search filters in DS (All versions)?

Indexes

Related Training

ForgeRock Directory Services Core Concepts (DS-400)

Related Issue Tracker IDs

N/A


Copyright and Trademarks Copyright © 2021 ForgeRock, all rights reserved.