05 Nov, 2014

1 commit

  • The ChangelogDBPurger is smart: when changes exist in the DB, it sleeps until the oldest change can be purged.
    The problem is that when admin changes the purge delay, the ChangelogDBPurger is not woken up to verify if the oldest change can be purged with the purge delay.
    This fix wakes up the ChangelogDBPurger when the purge delay changes.
    
    
    FileChangelogDB.java, JEChangelogDB.java:
    In setPurgeDelay(), ensured an existing ChangelogDBPurger is woken up by a change to the purge delay.
    Made purgeDelayInMillis volatile + In ChangelogDBPurger.run(), inlined jeFriendlySleep() to ensure the wait time is computed from the very latest purgeDelayInMillis.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@11253 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

30 Oct, 2014

1 commit

  • The problem happens when doing a search in the change number changelog.
    It only appears when there are two replicas under the same domain.
    When creating the domain cursor, it is initialized from the content of the change number index DB. A replica cursor is created for each replica. The first replica cursor is initialized from the CSN coming from the change number index DB while the second replica cursor is initialized from the null CSN.
    Under this circumstance, the second replica cursor is immediately added to the exhausted cursors of the domain cursor, and never gets out of it despite its replica DB being not empty.
    The reason is because next() is never called on the the underlying ReplServerDBCursor.
    
    
    JEReplicaDBCursor.java:
    In next(), test whether the cursor has already been initialized (rather than verifying if a previous record exists) in order to verify if this is the first time next() is called.
    Removed currentChange field which duplicates the content of ReplServerDBCursor.currentRecord .
    Better handled the cursor closed state in all the methods.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@11222 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

29 Oct, 2014

2 commits

  • git-svn-id: https://svn.forgerock.org/opendj/trunk@11218 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • 
    As pointed out by Ludo, problem is due to an API change in InternalClientConnection.processSearch() where LinkedHashSets parameters have been replaced with Set.
    Reverted revision r9082 which introduced the problem.
    
    Changed all client code to use LinkedHashSets instead of Sets.
    
    
    CollectionUtils.java:
    Added missing methods implemented in TestCaseUtils.
    
    TestCaseUtils.java, LDAPReplicationDomain.java:
    Removed generic methods creating collections.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@11216 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

28 Oct, 2014

2 commits


22 Oct, 2014

1 commit


21 Oct, 2014

1 commit

  • …eration against two replicated DS
    
    
    Fixed ConcurrentModificationException.
    I suspect the NoSuchElementException is thrown by the desugared foreach loop on an ArrayList.
    
    JEChangelogDB.java, FileChangelogDB.java:
    FOr the fields registeredDomainCursors and replicaCursors, replaced the use of ArrayList + synchronized keywords with using ConcurrentSkipListMap + CopyOnWriteArrayList to ensure thread safe access/modifications of these MultiMaps.
    Created putInMultiMap().
    Aligned code between the 2 implementations.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@11167 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

15 Oct, 2014

1 commit


14 Oct, 2014

1 commit


10 Oct, 2014

2 commits


09 Oct, 2014

1 commit


08 Oct, 2014

2 commits


07 Oct, 2014

2 commits


06 Oct, 2014

1 commit


23 Sep, 2014

1 commit


22 Sep, 2014

2 commits


18 Sep, 2014

3 commits


17 Sep, 2014

2 commits

  • Code was broken by the fix for OPENDJ-1541 Persistent search on cn=changelog can return duplicates.
    This change introduced a search phase enum and initialized all searches to the "initial search" phase.
    Current fix consist in directly initializing persistent searches with changesOnly=true to the "persistent search" phase.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@11013 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • There is a mismatch between code before and after r10757.
    This is affecting 2.6.x and 2.6.next OpenDJ servers communicating with each other.
    Before r10757, serialized ModifyMsg included a zero separator after byte arrays, after r10757 it did not.
    This change is introducing back the zero separator.
    
    ModifyMsg.java:
    In getBytes_V45(), appended the zero byte separator after byte arrays + adapted decodeBody_V4() code for it.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@11011 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

16 Sep, 2014

4 commits


15 Sep, 2014

2 commits

  • Persistent searches are registered before initial search ends (which is correct).
    Because a new change can be added to the changelog before the "initial search" phase is over, the "persistent search" phase can return this change before the "initial search" phase returns it later.
    
    To avoid this problem, persistent searches is marked with an enum to mention which phase is being run. The phases are the following:
    1. INITIAL: The "initial search" phase is running, the "persistent search" phase do not return any entry.
    2. TRANSITIONING: The "initial search" phase has completed and blocks currently running "persistent search" phase while the former is verifying no new updates where persisted to the DB
    3. PERSISTENT: The "initial search" phase is finished and completed the transition to the "persistent search" phase. The "persistent search" phase can return all entries.
    For the change-number-based persistent searches, only the last changeNumber sent by the "initial search" phase is recorded. For cookie-based persistent searches, for each replica, the last CSN sent by the "initial search" phase is recorded.
    
    Problem is that the transitioning phase has the potential to block the whole server if the client of the persistent search does not consume changes fast enough.
    This will be addressed separately.
    
    
    ChangelogBackend.java:
    Added constants COOKIE_ATTACHMENT and ENTRY_SENDER_ATTACHMENT.
    Added cookieBasedPersistentSearches and changeNumberBasedPersistentSearches fields.
    Added SearchPhase enum.
    Added CookieEntrySender, ChangeNumberEntrySender and SendEntryData static inner classes + made several methods static to call them from these classes.
    In initialSearchFromCookie(), initialSearchFromChangeNumber(), notifyEntryAdded() and registerPersistentSearch(), set or retrieved attachments + used entrySender.
    Extracted methods sendCookieEntriesFromCursor(), sendChangeNumberEntriesFromCursors().
    Added initializeAttachements().
    Split notifyEntryAdded() in two: notifyCookieEntryAdded() and notifyChangeNumberEntryAdded().
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@11000 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Persistent searches are registered before initial search ends (which is correct).
    Because a new change can be added to the changelog before the "initial search" phase is over, the "persistent search" phase can return this change before the "initial search" phase returns it later.
    
    To avoid this problem, persistent searches is marked with an enum to mention which phase is being run. The phases are the following:
    1. INITIAL: The "initial search" phase is running, the "persistent search" phase do not return any entry.
    2. TRANSITIONING: The "initial search" phase has completed and blocks currently running "persistent search" phase while the former is verifying no new updates where persisted to the DB
    3. PERSISTENT: The "initial search" phase is finished and completed the transition to the "persistent search" phase. The "persistent search" phase can return all entries.
    For the change-number-based persistent searches, only the last changeNumber sent by the "initial search" phase is recorded. For cookie-based persistent searches, for each replica, the last CSN sent by the "initial search" phase is recorded.
    
    Problem is that the transitioning phase has the potential to block the whole server if the client of the persistent search does not consume changes fast enough.
    This will be addressed separately.
    
    
    ChangelogBackend.java:
    Added constants COOKIE_ATTACHMENT and ENTRY_SENDER_ATTACHMENT.
    Added cookieBasedPersistentSearches and changeNumberBasedPersistentSearches fields.
    Added SearchPhase enum.
    Added CookieEntrySender, ChangeNumberEntrySender and SendEntryData static inner classes + made several methods static to call them from these classes.
    In initialSearchFromCookie(), initialSearchFromChangeNumber(), notifyEntryAdded() and registerPersistentSearch(), set or retrieved attachments + used entrySender.
    Extracted methods sendCookieEntriesFromCursor(), sendChangeNumberEntriesFromCursors().
    Added initializeAttachements().
    Split notifyEntryAdded() in two: notifyCookieEntryAdded() and notifyChangeNumberEntryAdded().
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10999 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

12 Sep, 2014

1 commit


08 Sep, 2014

1 commit


04 Sep, 2014

4 commits

  • git-svn-id: https://svn.forgerock.org/opendj/trunk@10992 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • git-svn-id: https://svn.forgerock.org/opendj/trunk@10991 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • …should not return the base changelog entry
    
    I did the following changes:
    
    - Persistent searches on cn=changelog with changesOnly=true no longer return the base changelog entry
    - Fixed a functional bug with setting hasSubordinates on the base changelog entry:
    -- hasSubordinates must be computed regardless of the search parameters, result can also be cached in memory once and for all
    - As a consequence, it means we can immediately return the base changelog entry for initial searches without even looking for any subordinate changelog entries.
    - Fixed a race condition when registering persistent searches: first set the cookie in the attachments then register the persistent searches
    - implementing numSubordinates() was not required and it might be buggy, so returned -1 instead.
    
    
    ChangelogBackend.java:
    In notifyEntryAdded() (a.k.a. persistent search phase), never return the base changelog entry.
    Removed EntrySender and moved all its methods back into ChangelogBackend + stored the MultiDomainServerState cookie as an attachment of the SearchOperation.
    Renamed search*() to internalSearch*().
    In hasSubordinates(), reimplemented it in a more efficient way + added baseChangelogHasSubordinates() and baseEntryHasSubordinates field to memoize its result.
    In numSubordinates(), is not required, so just returned -1 + removed NumSubordinatesSearchOperation.
    In registerPersistentSearch(), register the persistent searches after setting the cookie attachment on the search operation
    Completed javadocs.
    
    In registerPersistentSearch(), forced changesOnly=true persistent searches to never return the changelog base entry.
    Renamed Entry.hasReturnedBaseEntry field to mustReturnBaseEntry to fit the fact the changelog base entry might never be returned + inverted all the boolean expressions related to this field.
    
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10990 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • to support cn=changelog
    CR-4439
    
    Implementation of an additional validation of provided cookie when searching changelog
    in cookie mode. 
    
    Check for each state of the provided cookie that the csn is not older than the oldest CSN
    available in each domain. If this is not the case, then an error 
    ERR_RESYNC_REQUIRED_TOO_OLD_DOMAIN_IN_PROVIDED_COOKIE is returned. 
    
    This check was done previously in the ECLServerHandler class but was not ported when
    writing ChangelogBackend.  It also means I'm re-adding some methods deleted by the 
    previous big clean done by Jean-Noel. 
    
    Changes:
    * ReplicationServer.java : 
      - add the check to validateServerState() method
      - refactor validateServerState() method for better readability
    * ReplicationServerDomain.java : 
      - re-add getOldestState() method
    * ReplicationDomainDB. java : 
      - re-add getDomainOldestCSNs(DN) method
    * FileChangelogDB.java, JEChangelogDB.java : 
      - re-add implementation of getDomainOldestCSNs(DN) method
    
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10989 41b1ffd8-f28e-4786-ab96-9950f0a78031
    nicolas.capponi@forgerock.com
     

03 Sep, 2014

1 commit

  • After OPENDJ-1206, I could remove all old External ChangeLog (or ECL for short) related classes. I could also remove annoyingly strange APIs from various places of replication code.
    
    
    
    ECLUpdateMsg.java, ServerStartECLMsg.java, StartECLSessionMsg.java, ECLServerHandler.java, ECLServerWriter.java, ECLSearchOperation.java, ECLWorkflowElement.java, ExternalChangeLogTest.java: REMOVED
    Also removed package src/server/org/opends/server/workflowelement/externalchangelog as part of these deletes.
    
    replication*.properties:
    Removed now unused SEVERE_ERR_RESYNC_REQUIRED_TOO_OLD_DOMAIN_IN_PROVIDED_COOKIE.
    
    ReplicationMsg.java:
    Deprecated old ECL message types.
    
    ReplicationBroker.java, ReplicationServer.java:
    Removed all ECL related code.
    
    ReplicationServerDomain.java:
    Removed the now unused otherHandlers field, stopServer(MessageHandler), registerHandler(MessageHandler), unRegisterHandler(MessageHandler), unregisterOtherHandler(), getOldestState() and getLatestDomainTrimDate()
    
    ServerHandler.java
    Reduced visibility has much as possible after removing ECLServerHandler.
    
    
    
    MultimasterReplication.java:
    Renamed getECLDisabledDomains() to , included "cn=changelog" by default + changed client code to not add it anymore.
    
    LastCookieVirtualProvider.java:
    Consequence of the change to MultimasterReplication.
    
    ChangelogBackend.java:
    Consequence of the change to MultimasterReplication.getECLDisabledDomains().
    Removed SearchParams.requestType and replaced its usage with the new isCookieBasedSearch()
    
    
    
    MultiDomainServerState.java, ServerState.java, ReplicationDomainDB.java, FileChangelogDB.java, JEChangelogDB.java:
    Removed now unused methods / fields.
    Made private methods / fields that are now only used inside their declaration classes.
    
    
    
    ChangelogBackendTestCase.java, SynchronizationMsgTest.java, FileReplicaDBTest.java:
    Updated or removed tests as a consequences of the whole change.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@10986 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

02 Sep, 2014

1 commit