17 Sep, 2013

6 commits

  • Investigating ExternalChangeLogTest.ECLReplicationServerFullTest(), I found a bug introduced by r9538.
    In DraftCNDBCursor(long) ctor, when returning null, the code did not release the readLock anymore. Previously, it threw an exception that was caught, then released the readLock and rethrown.
    Problem is there was an underlying bug in the previous code too: when the DB was already closed, the readLock would not be released at all.
    
    Now by introducing the cursorHeld local variable, the readLock is appropriately released in the finally clause when no cursor is held at all.
    Also fixed the code in DraftCNDBCursor().
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9542 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • git-svn-id: https://svn.forgerock.org/opendj/trunk@9541 41b1ffd8-f28e-4786-ab96-9950f0a78031
    cjr
     
  • Added a debug statement to help diagnose a ClassCastException in ReplicationServerTest.windowProbeTest().
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9540 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • git-svn-id: https://svn.forgerock.org/opendj/trunk@9539 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Fixed nightly test org.opends.server.replication.server.ExternalChangeLogTest#ECLReplicationServerFullTest14 broken by r9505.
    
    r9505 allowed code to throw ChangelogException and removed several useless catch(), in particular, a catch was removed from DraftCNDbHandler's methods getPreviousCookie(), getCSN(), getBaseDN() which were predecessors of getRecord().
    Older code was throwing an exception, then catching it and returning null in some places while in other places, the exception was allowed to propagate.
    The final change removed the unnecessary exception throwing and swallowing where it was useless. The exception is now thrown again where it is useful.
    
    
    DraftCNDB.java:
    In DraftCNDBCursor(long) ctor, removed throwing the exception and return an empty cursor instead.
    
    DraftCNDbIterator.java:
    In DraftCNDbIterator() ctor, throw an exception when the cursor is empty.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9538 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • …tion topology at the same time
    
    Properly marked the state of the thread + checked it from the deeper DbHandler.trim() to ensure the thread stops as fast as possible. DB reentrant locsk then ensure the threads properly wait on each other before shutdown.
    
    DirectoryThread.java:
    Added ThreadState enum + a threadState AtomicReference instance field.
    Added isShutdownInitiated(), initiateShutdown(), startWork(), stopWork(), setThreadStateIfNotShuttingDown(), getThreadState().
    Converted comments to javadocs.
    In uncaughtException(), do not log ThreadDeath error (coming from Ludo, suggested as part of OPENDJ-1061).
    
    DbHandler.java:
    Removed shutdown and done instance fields (replaced by the DirectoryThread.threadState). The done instance field had an ill defined purpose and its usefulness was questionable.
    In shutdown(), used DirectoryThread thread state management methods + removed dead code.
    In run() and trim(), used DirectoryThread thread state management methods.
    
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9537 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

16 Sep, 2013

4 commits


13 Sep, 2013

4 commits


07 Sep, 2013

2 commits


06 Sep, 2013

12 commits

  • Added ChangelogDB interface to abstract all the remaining code away from JE.
    
    
    
    ChangelogDB.java, ChangelogState.java, Pair.java: ADDED
    
    JEChangelogDB.java: ADDED
    Created from code in ReplicationServer and ReplicationServerDomain.
    
    
    ReplicationServer.java:
    Moved a lot of code to JEChangelogDB.
    Added ChangelogDB field and delegated existing method calls to it.
    Added getChangelogDB().
    Made getChangeNumberIndexDB() package protected for the tests.
    
    ReplicationServerDomain.java:
    Moved a lot of code to JEChangelogDB.
    Replaced sourceDbHandlers field with ChangelogDB field.
    Renamed publishMessage() to publishUpdateMsg().
    FIXME!!!! Bug: generationIdSavedStatus is not protected by synchronized (sourceDbHandlers) !!!!!
    
    ReplicationDbEnv.java:
    Changed void initializeFromChangelogStateDB() to ChangelogState readChangelogState()
    
    
    ExternalChangeLogTest.java:
    Moved from package org.opends.server.replication to org.opends.server.replication.server.
    Extracted method getReplicationDomainStartState()
    
    ChangelogException.java:
    Changed one ctor visibility to public.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9524 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • git-svn-id: https://svn.forgerock.org/opendj/trunk@9523 41b1ffd8-f28e-4786-ab96-9950f0a78031
    mark
     
  • Removed unused getGenerationIdSavedStatus().
    Removed savedStatus parameter from changeGenerationId() and defaulted it to false since all callers were calling it with false.
    
    DataServerHandler.java, ReplicationServerHandler.java, ServerHandler.java:
    Consequence of the change to ReplicationServerDomain.changeGenerationId().
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9522 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • * fix JDK6 build - InetAddress.getLoopbackAddress() is JDK7 only.
    
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9521 41b1ffd8-f28e-4786-ab96-9950f0a78031
    matthew
     
  • * cache network listener enumeration results for 30s
    * streamline connect thread URL iteration.
    
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9520 41b1ffd8-f28e-4786-ab96-9950f0a78031
    matthew
     
  • git-svn-id: https://svn.forgerock.org/opendj/trunk@9519 41b1ffd8-f28e-4786-ab96-9950f0a78031
    violette
     
  • Little code cleanup.
    Extracted a few methods and removed duplicated/unused code.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9518 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • git-svn-id: https://svn.forgerock.org/opendj/trunk@9517 41b1ffd8-f28e-4786-ab96-9950f0a78031
    violette
     
  • Renamed CNIndexData to CNIndexRecord.
    
    
    ChangeNumberIndexDB.java:
    Renamed getCNIndexData(changeNumber),  getFirstCNIndexData(), getLastCNIndexData() to getRecord(changeNumber), getFirstRecord(),  getLastRecord().
    
    ChangeNumberIndexDBCursor.java:
    Renamed getCNIndexData() to getRecord().
    
    
    *.java:
    Consequence of these changes.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9516 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Reviewed by Violette over IM
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9515 41b1ffd8-f28e-4786-ab96-9950f0a78031
    mark
     
  • …ex when upgrading from 2.5.0-Xpress
    
    Reviewed by Violette over IM
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9514 41b1ffd8-f28e-4786-ab96-9950f0a78031
    mark
     
  • - removed start task action (unused)
    - removed verifyTaskType function (unused)
    - used LDIF.search to retrieve backends (rebuild index works only on 'enabled' backend).
    - added rebuild all index task.
     - In case of an upgrade where a rebuild all task is present :
        . All the other single rebuild indexes are bypass.
        . Rebuild-all is launched only if the the user wants to.
    
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9513 41b1ffd8-f28e-4786-ab96-9950f0a78031
    violette
     

05 Sep, 2013

5 commits

  • …th a dot, unlike Javadoc)
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9512 41b1ffd8-f28e-4786-ab96-9950f0a78031
    ludo
     
  • 
    Fixed a few bugs (introduced in the previous commits?):
    - All code must check that the result of calling ChangeNumberIndexDB.getFirstCNIndexData() and ChangeNumberIndexDB.getLastCNIndexData() are not null (if the DB is empty, or closed, etc.).
    - In ReplicationServer.clearGenerationId(), the code could have a side effect if the last entry in the DB was cleared by this method: the lastGeneratedChangeNumber would be allowed to go back!
    
    
    ChangeNumberIndexDB.java:
    Removed getLastChangeNumber().
    
    DraftCNDbHandler.java:
    Inlined getLastChangeNumber() to the only remaining method caller ReplicationServer.getChangeNumberIndexDB().
    Finally changed the implementation of isEmpty() to something less costly.
    
    DraftCNDbHandlerTest.java:
    Inlined getFirstChangeNumber() and getLastChangeNumber().
    
    
    ReplicationServer.java:
    In clearGenerationId(), removed the code changing the value of lastGeneratedChangeNumber: lastGeneratedChangeNumber is not allowed to go backward.
    In getChangeNumberIndexDB(), inlined here the code of DraftCNDbHandler.getLastChangeNumber() + removed useless use of MessageBuilder.
    In getECLChangeNumberLimits(), added a null check for the result of getLastCNIndexData().
    
    replication.properties:
    Added a new error message.
    Changed MILD_ERR_DRAFT_CHANGENUMBER_DATABASE_173 to MILD_ERR_CHANGENUMBER_DATABASE_173.
    
    
    ECLServerHandler.java:
    In findCookie(), replaced the DB empty checks by null checks on the return of getFirstCNIndexData() and getLastCNIndexData() since this is purely equivalent.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9511 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • git-svn-id: https://svn.forgerock.org/opendj/trunk@9510 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Remainder of r9504: changed changeNumber from int to long.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9509 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • 
    Added CNIndexData class to replace the conjunct use of the (CSN, baseDN, previousCookie) tuple along with the changeNumber.
    It allowed to replace:
    - several parameters list with all theses types
    - several groups of methods returning instances of these types with duplicate code in the implementation.
    
    Remainder of r9504: changed changeNumber from int to long.
    
    
    CNIndexData.java: ADDED
    
    *.java:
    Consequence of introducing CNIndexData class.
    
    
    ECLServerHandler.java:
    Renamed releaseIterator() into releaseCursor().
    In getNextECLUpdate(), aggregated consecutive if statements + added a debugInfo().
    Renamed assignNewDraftCNAndStore() to assignNewChangeNumberAndStore().
    Changed changeNumber from int to long.
    
    ChangeNumberIndexDB.java:
    Replaced getCSN(), getBaseDN() and getPreviousCookie() by getCNIndexData().
    Renamed getFirstChangeNumber() to getFirstCNIndexData().
    Added getLastCNIndexData().
    Changed add() signature.
    
    DraftCNDbHandler.java
    Consequence of the change to implemented interface ChangeNumberIndexDB.
    Changed changeNumber from int to long.
    Added getChangeNumber().
    
    
    ChangeNumberIndexDBCursor.java:
    Replaced getCSN(), getBaseDN() and getPreviousCookie() by getCNIndexData().
    
    DraftCNDbIterator.java
    Consequence of the change to implemented interface ChangeNumberIndexDBCursor.
    
    
    DraftCNData.java:
    Added changeNumber field + getter.
    Replaced fields value, baseDN and csn by cnIndexData + getters.
    Renamed readFirstChangeNumber() and readLastChangeNumber() to readFirstCNIndexData() and readLastCNIndexData().
    Added newCNIndexData().
    In inner class DraftCNDBCursor, Field key is now a ReplicationDraftCNKey (was DatabaseEntry) + DraftCNData field has been replaced with CNIndexData + entry is initialized on construction.
    Replaced currentValue(), currentBaseDN(), currentCSN() and currentKey() by currentData().
    Removed getKey().
    
    ReplicationDraftCNKey.java:
    Added a default ctor.
    In getChangeNumber(), matched the code in DraftCNDB.
    
    DraftCNDbHandlerTest.java:
    Added assertEqualTo(), getFirstChangeNumber(), getLastChangeNumber(), getPreviousCookie().
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9508 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

04 Sep, 2013

7 commits