The synchronization changelog monitoring information has a counter named
waiting-changes that publish the number of updates known by the changelog
server that have not yest been sent to each ldap server because they are too slow to replay them.
This is calculated from the list of changes in memory when this list is small
enough. However when this list becomes too large it is not possible to keep
all the changes in memory and the changes therefore goes to disk.
This monitoring information therefore becomes unavailable and currently returns MAXINT.
This is unfortunate because this is the time when it is the most important.
Unfortunately the Java edition of the berkeley DB does not provide a way to
know the record number of a given db entry and therefore we can't rely on the DB
to tell us how many changes stay in the db after the current change.
This fix therefore change the format of the ChangeNumber so that the ChangeNumber
now uses consecutive numbers for its seqnum part.
The number of missing changes can therefore be calculated by a simple substraction
of the current seqnum and the largest seqnum.
the drawback of this method is that it is only accurate if the majority of update
operations done on the masters are successfull because this method also count the failed
operations.
This fix also modify the ProtocolWindowTest in order to add tests of this waiting-changes
monitoring information.
This fix also makes the size of the memory queue of messages configurable.