23 Jun, 2014
2 commits
-
* tools.properties ** Adding the description message of the upgrade task * Upgrade.java ** Upgrade task n° 2.7.0.10820 which add the 'changelog-read' value to the Root DNs default privilege list * ExternalChangeLogTest.java ** ChangeLog privilege unit test code refactoring to make it more compact ant more meaningful git-svn-id: https://svn.forgerock.org/opendj/trunk@10823 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Partly reverted r10688: Using ChangeTimeHeartbeatMsg to convey replica offline messages is not a good approach. Future change will introduce a new message type: ReplicaOfflineMsg. git-svn-id: https://svn.forgerock.org/opendj/trunk@10822 41b1ffd8-f28e-4786-ab96-9950f0a78031
20 Jun, 2014
1 commit
-
* config.ldiff ** Add the 'changelog-read' value to the 'ds-default-root-privilege-name' multi-valued attribute * GlobalConfiguration.xml RootDNConfiguration.xml ADSContext.java Privilege.java RootPrivilegeChangeListener.java ** Add the 'changelog-read' privilege where is was needed * GlobalCfgDefn.properties RootDNCfgDefn.properties ** Add 'changelog-read' privilege definition * replication.properties replication_fr.properties ** Add messages to prevent user that he needs to have the 'changelog-read' privilege if he wants to search on changelog * ECLSearchOperation.java ** Add a check to verify that the current connection has the 'changelog-read' privilege before starting the changelog search * ExternalChangeLogTest.java ** Unit test which ensure that is not possible to perform a changelog search without the 'changelog-read' privilege git-svn-id: https://svn.forgerock.org/opendj/trunk@10820 41b1ffd8-f28e-4786-ab96-9950f0a78031
19 Jun, 2014
1 commit
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@10819 41b1ffd8-f28e-4786-ab96-9950f0a78031
17 Jun, 2014
1 commit
-
…ver from a previous failure CR-3768 * LogFile.java ** Add a check of file validity in constructor when log file is write-enabled ** Recover the file if it is corrupted (partially written record) by truncating it * BlockLogReader.java ** Add method checkLogIsValid() to check validity of file * replication.properties ** Add new messages related to check and recovery * LogFileTest.java ** Add tests for recovery after log file corruption * Minor changes in other files git-svn-id: https://svn.forgerock.org/opendj/trunk@10816 41b1ffd8-f28e-4786-ab96-9950f0a78031
13 Jun, 2014
3 commits
-
Issue: On resetting the generationId in RS2, the ServerReader thread is blocked waiting on the ChangeNumberIndexer thread that is waiting on new changes. The fix consisted in ensuring the replicaDB cursors are released by the ChangeNumberIndexer thread when a replicaDB is being cleared. ChangeNumberIndexer.java: Changed AtomicBoolean doClear field into ConcurrentSkipListSet<DN> domainsToClear. Changed removeAllCursors() to removeCursors(DN baseDN). In clear(), added a DN parameter. JEChangelogDB.java, FileChangelogDB.java: Called ChangeNumberIndexer.clear() from removeDomain() rather than from clearDB(). git-svn-id: https://svn.forgerock.org/opendj/trunk@10809 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
In decodeRecord(), changed changeNumber local variable from long to Long. Code cleanup. git-svn-id: https://svn.forgerock.org/opendj/trunk@10808 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
ReplicationBroker.java: Reverted one change from r10786 which broke replication.fractional functional tests. git-svn-id: https://svn.forgerock.org/opendj/trunk@10807 41b1ffd8-f28e-4786-ab96-9950f0a78031
12 Jun, 2014
2 commits
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@10806 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
CR-3727 Implements read and write with blocks, to enable binary search. * New BlockLogReader class: read records sequentially or using binary search provided a key * New BlockLogWriter class: write records by blocks * New BlockLogReaderWriterTest class : tests read/write with blocks * Update LogFile : delegate responsibility for read/write to BlockLogXXX * Add method ByteStringBuilder#append(DataInput, int) to avoid byte array copy * Minor changes in other files git-svn-id: https://svn.forgerock.org/opendj/trunk@10805 41b1ffd8-f28e-4786-ab96-9950f0a78031
11 Jun, 2014
1 commit
-
…ing ReplicationBackend class Added upgrade tasks for: - Removing 'dc=replicationchanges' backend - Removing ACI for 'dc=replicationchanges' Upgrade.java: Registered upgrade tasks. UpgradeTasks.java: Added deleteConfigEntry(). Factorized code by extracting method perform0(). Fixed javadocs. UpgradeUtils.java: In updateConfigFile(), renamed lines parameter to ldifLines + changed String dn local variable to DN ldifDN + added support for deleting entries. tools.properties: Added messages for upgrade tasks. Fixed typos. admin_tool.properties: Fixed typos. SaltedMD5PasswordStorageSchemeTestCase.java: Removed unused import. git-svn-id: https://svn.forgerock.org/opendj/trunk@10800 41b1ffd8-f28e-4786-ab96-9950f0a78031
10 Jun, 2014
1 commit
-
DirectoryServer.getClassLoader() is used by SNMPClassLoaderProvider, so made it public again. git-svn-id: https://svn.forgerock.org/opendj/trunk@10796 41b1ffd8-f28e-4786-ab96-9950f0a78031
06 Jun, 2014
1 commit
-
Left over changes from a failed attempt at sending replica offline messages after all update messages have been sent on replica shutdown (see the JIRA issue for details): - Shutdown sequence improvements (reordered shutdown stages) - Code cleanups / refactorings / clarifications DirectoryServer.java: In shutDown(), removed dead code + reordered stages to: shutdown connection handlers, then work queue, then replication, then the rest. shutting down the work queue waits for the worker threads to exit for ServerShutdownMonitor.WAIT_TIME. To be improved by OPENDJ-1469 2 phase shutdown Made several constants final. Made several methods private. ServerShutdownMonitor.java: Extracted WAIT_TIME constants to reuse it in DirectoryServer.shutDown(). ReplicationBroker.java Reordered shutdown sequence: first shutdown changeTime heartbeat publisher thread, then RS heartbeat monitoring thread, then set no connected RS. ReplicationDomain.java, DummyReplicationDomain.java: Made status private + added signalNewStatus(). LDAPReplicationDomain.java: Consequence of the change to signalNewStatus(). ReplicationServerDomain.java: Added PendingStatusMessages.toString(). Made some methods private. In sendPendingTopologyMsgs(), avoid building a topology message if there is no RSs to send it to. PendingChange.java: Code cleanup. Removed useless field/methods targetDN, getTargetDN(), setOp(). Added toString(). PendingChanges.java: In putLocalOperation(), avoid storing synchronization operations because they will never be sent (see code in pushCommittedChanges()). In pushCommittedChanges(), made better use of TreeMap API + do not return int anymore (it was never used). In commitAndPushCommittedChanges(), do not return int anymore (it was never used). RemotePendingChanges.java: Consequence of the change to PendingChange.getTargetDN(). Renamed targetDn local variables to targetDN. TraditionalWorkerThread.java, CSNGenerator.java: Code cleanup. git-svn-id: https://svn.forgerock.org/opendj/trunk@10786 41b1ffd8-f28e-4786-ab96-9950f0a78031
05 Jun, 2014
1 commit
-
Added a test case for the change number computation + fixed the code to support it. In ChangeNumberIndexer.run(), fixed a bug where shutdown forces an insert in the Change number index DB. ChangeNumberIndexerTest.java: Added emptyDBTwoDSsOneKilled test. Fixed timestamps in a few tests. ChangeNumberIndexer.java: Initialized nextChangeForInsertDBCursor field to avoid NPE on startup. Added getOldestLastAliveCSN(), mightMoveForwardMediumConsistencyPoint() + used it in tryNotify(). Changed canMoveForwardMediumConsistencyPoint() to canMoveForwardMediumConsistencyPoint(CSN). Removed mediumConsistency field, unused now. In run(), fixed a bug where shutdown forces an insert in the Change number index DB. Updated javadocs. MultiDomainServerState.java, MultiDomainServerStateTest.java: Added getOldestCSNExcluding() and isReplicaExcluded(). git-svn-id: https://svn.forgerock.org/opendj/trunk@10781 41b1ffd8-f28e-4786-ab96-9950f0a78031
04 Jun, 2014
3 commits
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@10780 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
replication topology with file-based changelog OPENDJ-1487 : File based changelog : cursors opened when clearing the log Log.java : * Ensure cursors opened on log are temporarily disabled before rotating the head (to avoid renaming the file while reader are opened on it) * Allow cursors to be opened on log when performing a clear on the log, turning them into empty cursors. git-svn-id: https://svn.forgerock.org/opendj/trunk@10778 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Problem was due to an NPE while deserializing StartECLSessionMsg: ByteArrayScanner.nextString(), can return null, while previous code was always creating an empty string when using the older API. Thanks Nicolas Capponi for bisecting. StartECLSessionMsg.java: In ctor, added a null check to prevent NPE. git-svn-id: https://svn.forgerock.org/opendj/trunk@10777 41b1ffd8-f28e-4786-ab96-9950f0a78031
03 Jun, 2014
3 commits
-
…in monitoring section when it is disabled git-svn-id: https://svn.forgerock.org/opendj/trunk@10776 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@10774 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
* File-based changelog Store the offline CSN when a replica goes offline Read the offline CSN if present to build the changelog state at startup Update ReplicationEnvironment.java to manage read and write from/to storage Update ReplicationEnvironmentTest.java with more unit tests Update replication.properties with new messages * File and JE based changelog Remove the offline CSN if present when receiving an heartbeat or an update message Update FileChangelogDB.java, JEChangelogDB.java, ReplicationDBEnv.java to manage online replica notification * Other minor updates : renaming, comments git-svn-id: https://svn.forgerock.org/opendj/trunk@10773 41b1ffd8-f28e-4786-ab96-9950f0a78031
28 May, 2014
2 commits
-
replication topology with file-based changelog Log.java : add last key appended to the log when logging the rejection of a record git-svn-id: https://svn.forgerock.org/opendj/trunk@10766 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
replication topology with file-based changelog The root cause is that records may be appended more than once to the changelog and in an order that is breaking the key ordering. Update Log.java to reject any append of a record that has a key that would break the ordering of records in the log (ie, key lower than or equal to the last key appended). git-svn-id: https://svn.forgerock.org/opendj/trunk@10765 41b1ffd8-f28e-4786-ab96-9950f0a78031
26 May, 2014
1 commit
-
….append*() methods and getting rid of all method overloading. ByteArrayBuilder.java: Renamed all append*() and append*UTF8() methods to non overloaded methods. Renamed append(ServerState() to appendServerStateMustComeLast(). Renamed appendZeroTerminated() to appendZeroTerminatedByteArray() ByteArrayScanner.java: Renamed nextServerState() to nextServerStateMustComeLast(). TODO *.java: Consequence of the changes to ByteArrayBuilder + ByteArrayScanner. git-svn-id: https://svn.forgerock.org/opendj/trunk@10762 41b1ffd8-f28e-4786-ab96-9950f0a78031
23 May, 2014
4 commits
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@10759 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
The downside of this change is that now there could be superfluous byte array copies when appending to a ByteArrayBuilder while code before was building the final byte array once after the final size was known. If this proves to be a performance hit, it could be optimized later by building the final byte array on the call to ByteArrayBuilder.toByteArray(). Since OpenDJ 2.8 will introduce a protocol version change, it could be a good time to further cleanup the protocol by always encoding ints, longs, CSNs and booleans in their most compact representations. It should also be possible to remove zero terminated madness for anything else than strings. ByteArrayBuilder.java, ByteArrayScanner.java: Changed existing code to exactly match legacy behaviour. Added methods to simplify protocol (de)serialization. In ByteArrayBuilder ctor, set the default byte array size to 256 to avoid too copying byte arrays too many times initially. ByteArrayTest.java: Added tests for new functionalities. Increased coverage. AckMsg.java: In errorsToString(), used List.toString(). MonitorMsg.java: In ctor, used setServerState(). ReplicationMsg.java: Removed now unused methods getNextLength() and addByteArray(). StartSessionMsg.java: Removed ctor only called from tests. ReplicationServerTest.java: Consequence of removing a ctor for StartSessionMsg. NotAssuredUpdateMsg.java: Extracted methods getRealUpdateMsgBytes(), findNthZeroByte(), ServerState.java: Moved ctor code to ByteArrayScanner.nextServerState() + removed getNextLength(). Moved getBytes() code to ByteArrayBuilder.append(ServerState) + removed addByteArray(). Added method getServerIdToCSNMap(). ServerStateTest.java: Consequence of the change to ServerState class. ReplicationData.java: REMOVED, not used anymore ReplicationDB.java: Consequence of removing ReplicationData. Removed dead methods getPreviousCSN() and getRegularRecord(). *Msg.java: Inlined a few methods (getBytes_V1() for example) to make the code clearer. *.java: Removed comments paraphrasing the code. Removed now unnecessary exception handling + declarations for UnsupportedEncodingExceptions. Added final keywords. Reduced visibility of class members. Fixed javadocs. git-svn-id: https://svn.forgerock.org/opendj/trunk@10757 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
FileChangeNumberIndexDB.java, JEChangeNumberIndexDB.java: Renamed DbMonitorProvider.getChangeNumber() to readChangeNumber() + reused getChangeNumber(Record) + used NO_KEY constant. git-svn-id: https://svn.forgerock.org/opendj/trunk@10755 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
ServerShutdownMonitor.java: Factorized code by extracting methods waitAllThreadsDied() and removeDeadThreads(). Used StaticUtils.sleep(10). git-svn-id: https://svn.forgerock.org/opendj/trunk@10752 41b1ffd8-f28e-4786-ab96-9950f0a78031
22 May, 2014
1 commit
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@10751 41b1ffd8-f28e-4786-ab96-9950f0a78031
21 May, 2014
1 commit
-
Implemented a log based on multiple log files * Add Log class that manage a log as a set of log files: ** it contains at least one log file, the head log file, where new records are appended ** it contains from zero to multiple read-only log files, issued from rotation of the head log file when it reaches a given size * Update LogFile class to act as part of a Log. * Add purging feature * Update other classes from file package with minor changes * Add unit tests for new Log class and purging feature * Update MeteredStream class to use it in changelog * Add new interface RotatableLogFile (to be used later by changelog) * Update Policy classes to use this new interface git-svn-id: https://svn.forgerock.org/opendj/trunk@10746 41b1ffd8-f28e-4786-ab96-9950f0a78031
20 May, 2014
2 commits
-
Used UCDetector and AutoRefactor Eclipse plugins to: * reduce visibility of class members, * add final keywords to fields, * convert comments to javadocs, * etc. git-svn-id: https://svn.forgerock.org/opendj/trunk@10745 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
…rily leaving the topology Added more tests about how changeNumber computation is performed WRT replicas offline messages and RS restarts. ChangeNumberIndexerTest.java: Tested additional scenarios: emptyDBTwoDSsOneInitiallyOffline(), emptyDBTwoDSsOneInitiallyWithChangesThenOffline(), emptyDBTwoDSsOneInitiallyPersistedOfflineThenChanges(). In several tests, called assertExternalChangelogContent() after calling startCNIndexer(). Renamed setDBInitialRecords() to setCNIndexDBInitialRecords(). Added more javadocs. Used @Mock + MockitoAnnotations.initMocks() instead of several calls to Mockito.mock(). ChangeNumberIndexer.java: Changed the code to support the additional scenarios. Renamed allInitialReplicasArePastOldestPossibleCSN() to allInitialReplicasAreOfflineOrAlive(). Changed removeCursor() into getCursor(). git-svn-id: https://svn.forgerock.org/opendj/trunk@10736 41b1ffd8-f28e-4786-ab96-9950f0a78031
18 May, 2014
1 commit
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@10734 41b1ffd8-f28e-4786-ab96-9950f0a78031
16 May, 2014
1 commit
-
JE was throwing exception when the thread accessing it had been interrupted which happens frequently on single core machines. The solution is to replace the use of Thread.sleep(long) + Thread.interrupt() with Object.wait(long) + Object.notify() on thread shutdown. JEChangelogDB.java: Replaces the use of Thread.sleep(long) + Thread.interrupt() with Object.wait(long) + Object.notify() on thread shutdown. Created method jeFriendlySleep(long) to emulate Thread.sleep(long). ReplicationServer.java: Code cleanup. Changed shutdown field from boolean to AtomicBoolean. Added final keyword to fields. Reduced visibility of waitConnections() from public to default. In shutdown(), used StaticUtils.close(). git-svn-id: https://svn.forgerock.org/opendj/trunk@10733 41b1ffd8-f28e-4786-ab96-9950f0a78031
15 May, 2014
3 commits
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@10730 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
…s expired even if the expired provided password is wrong git-svn-id: https://svn.forgerock.org/opendj/trunk@10729 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
ExternalChangeLogTest.java: Fixed (?) random failures by comparing LDIF values (rightly line ordering insensitive) rather than String values (wrongly line ordering sensitive). Added checkLDIF() and toLDIFEntries(). In checkValues(), changed assert. LDAPReplicationDomain.java: Changed shutdown field from boolean to AtomicBoolean. Removed shutdown field and initiateShutdown() from RSUpdater. In buildAndPublishMissingChanges(), removed AtomicBoolean parameter. HistoricalCsnOrderingTest.java: Consequence of the change to LDAPReplicationDomain.buildAndPublishMissingChanges(). Reduced visibilities + added final keyword to fields. DomainFakeCfg.java: Removed 2 unused ctors, addECLDomainAddListener(), removeECLDomainAddListener(), addECLDomainDeleteListener(), removeECLDomainDeleteListener(). CryptoManagerImpl.java: Fixed javadocs. Removed useless StringBuilder uses. git-svn-id: https://svn.forgerock.org/opendj/trunk@10728 41b1ffd8-f28e-4786-ab96-9950f0a78031
14 May, 2014
4 commits
-
LDAPReplicationDomain.java: Removed generator field, duplicated with super class. Extracted method getFirstResult(InternalSearchOperation). In findAndRenameChild(), removed useless null check. PersistentServerState.java Changed visibilities to default or private. Removed conn field + used static import instead. Removed on ctor only used by tests. In save() simplified the code a lot. In checkAndUpdateServerState(), reduced local variable scope + renamed a few of them. Extracted method getFirstResult(InternalSearchOperation). PersistentServerStateTest.java: Consequence of removing one ctor from PersistentServerState. git-svn-id: https://svn.forgerock.org/opendj/trunk@10727 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@10724 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
LDAPReplicationDomain.java: Changed numReplayedPostOpCalled field from int to AtomicInteger. Extracted methods newSet(), newList(), exists(), canRemoveAttribute(). Inlined getPendingUpdatesCount(), getNumReplayedPostOpCalled(), getNumResolvedModifyConflicts(), getNumResolvedNamingConflicts() and getNumUnresolvedNamingConflicts(). In contains(), changed parameter names. Added javadocs to instance variables. Reduced visibilities to default or private. Added braces to if statements. Used static imports. Fixed Eclipse warnings. Replaced unnecessary use of MessageBuilder by adding arguments to replication messages. replication*.properties: Modified messages to include arguments. PendingChanges.java: Updated copyright year after r10722. git-svn-id: https://svn.forgerock.org/opendj/trunk@10723 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
PendingChanges.java: Removed unused commit(CSN). In remove(CSN), now return void. Reduced visibilities to default or private. Used final keyword. git-svn-id: https://svn.forgerock.org/opendj/trunk@10722 41b1ffd8-f28e-4786-ab96-9950f0a78031