mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
19.09.2015 e8f074bf0a983cd40b87a94dd3f971a0011e45ef
refs
author Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Friday, June 19, 2015 15:09 +0200
committer Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Friday, June 19, 2015 15:09 +0200
commite8f074bf0a983cd40b87a94dd3f971a0011e45ef
tree 8a499c804c79bdee33f51c42f9a4298146e07885 tree | zip | gz
parent 6a8156db0ca409d8e5c60ba7eec4e95ecaa68482 view | diff
OPENDJ-2154 (CR-7325) search on cn=monitor changenumber index database times out


With a very large changelogDb, when issuing queries on cn=monitor, the code counts the number of entries in the changeNumberIndexDb. In order to do the count, it cursors through the changeNumberIndexDb, decoding each and every change in the changeNumberIndexDb.
This is a killer with very large changelogDb.
Any query on cn=monitor with very large file-based changelogDb is now at risk to timeout.

JE has a direct API to count the number of records in a tree.
File based changelog does not have such API, thus, a first implementation was to count the changes by cursoring through the changeNumberIndexDb.
However, since the changeNumberIndexDb purge has been reimplemented, there are no longer "holes" in the changeNumbers. As a consequence, a simple way to count the number of changes is to do "newestChangeNumber - oldestChangeNumber".



FileChangeNumberIndexDB.java:
In DbMonitorProvider.getMonitorData(), changed the code to make a diff between first and last changeNumber.
Introduced ChangeNumberType enum to get rid of unreadable boolean parameter.
Extracted toAttribute() from createChangeNumberAttribute().
1 files modified
90 ■■■■■ changed files
opendj-sdk/opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/FileChangeNumberIndexDB.java 90 ●●●●● diff | view | raw | blame | history