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

Jean-Noel Rouvignac
19.09.2015 3794b2a11e287845176b0a4b849725af2d992019
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
commit3794b2a11e287845176b0a4b849725af2d992019
tree d65d05bc04415032b4ce50485384734ec3623139 tree | zip | gz
parent 6358adbac5125b9c8731f4a602fa52ca430cf4dc 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-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/FileChangeNumberIndexDB.java 90 ●●●●● diff | view | raw | blame | history