opends/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java
@@ -2618,7 +2618,7 @@ public void replay(LDAPUpdateMsg msg) { Operation op = null; boolean done = false; boolean replayDone = false; boolean dependency = false; ChangeNumber changeNumber = null; int retryCount = 10; @@ -2633,7 +2633,7 @@ op = msg.createOperation(conn); dependency = remotePendingChanges.checkDependencies(op, msg); while ((!dependency) && (!done) && (retryCount-- > 0)) while ((!dependency) && (!replayDone) && (retryCount-- > 0)) { // Try replay the operation op.setInternalOperation(true); @@ -2656,7 +2656,7 @@ // was a no-op. For example, an add which has already been // replayed, or a modify DN operation on an entry which has been // renamed by a more recent modify DN. done = true; replayDone = true; } else if (op instanceof ModifyOperation) { @@ -2664,14 +2664,14 @@ dependency = remotePendingChanges .checkDependencies(newOp); ModifyMsg modifyMsg = (ModifyMsg) msg; done = solveNamingConflict(newOp, modifyMsg); replayDone = solveNamingConflict(newOp, modifyMsg); } else if (op instanceof DeleteOperation) { DeleteOperation newOp = (DeleteOperation) op; dependency = remotePendingChanges .checkDependencies(newOp); done = solveNamingConflict(newOp, msg); replayDone = solveNamingConflict(newOp, msg); } else if (op instanceof AddOperation) { @@ -2679,19 +2679,19 @@ AddMsg addMsg = (AddMsg) msg; dependency = remotePendingChanges .checkDependencies(newOp); done = solveNamingConflict(newOp, addMsg); replayDone = solveNamingConflict(newOp, addMsg); } else if (op instanceof ModifyDNOperationBasis) { ModifyDNOperationBasis newOp = (ModifyDNOperationBasis) op; done = solveNamingConflict(newOp, msg); replayDone = solveNamingConflict(newOp, msg); } else { done = true; // unknown type of operation ?! replayDone = true; // unknown type of operation ?! } if (done) if (replayDone) { // the update became a dummy update and the result // of the conflict resolution phase is to do nothing. @@ -2711,11 +2711,11 @@ } else { done = true; replayDone = true; } } if (!done && !dependency) if (!replayDone && !dependency) { // Continue with the next change but the servers could now become // inconsistent. @@ -2781,7 +2781,7 @@ msg = remotePendingChanges.getNextUpdate(); // Prepare restart of loop done = false; replayDone = false; dependency = false; changeNumber = null; retryCount = 10; @@ -4178,6 +4178,8 @@ importConfig.setIncludeBranches(includeBranches); importConfig.setAppendToExistingData(false); importConfig.setSkipDNValidation(true); // We should not validate schema for replication importConfig.setValidateSchema(false); // Allow fractional replication ldif import plugin to be called importConfig.setInvokeImportPlugins(true); // Reset the follow import flag and message before starting the import @@ -4590,6 +4592,8 @@ "ds-cfg-enabled: " + (!getBackend().isPrivateBackend())); LDIFImportConfig ldifImportConfig = new LDIFImportConfig( new StringReader(ldif)); // No need to validate schema in replication ldifImportConfig.setValidateSchema(false); LDIFReader reader = new LDIFReader(ldifImportConfig); Entry eclEntry = reader.readEntry(); DirectoryServer.getConfigHandler().addEntry(eclEntry, null); opends/tests/unit-tests-testng/src/server/org/opends/server/replication/InitOnLineTest.java
@@ -23,7 +23,7 @@ * * * Copyright 2006-2010 Sun Microsystems, Inc. * Portions Copyright 2011 ForgeRock AS * Portions Copyright 2011-2012 ForgeRock AS */ package org.opends.server.replication; @@ -68,8 +68,6 @@ import org.opends.server.replication.protocol.DoneMsg; import org.opends.server.replication.protocol.EntryMsg; import org.opends.server.replication.protocol.ErrorMsg; import org.opends.server.replication.protocol.AddMsg; import org.opends.server.replication.protocol.HeartbeatThread; import org.opends.server.replication.protocol.InitializeRequestMsg; import org.opends.server.replication.protocol.InitializeTargetMsg; import org.opends.server.replication.protocol.ReplicationMsg; @@ -175,6 +173,7 @@ * If the environment could not be set up. */ @BeforeClass @Override public void setUp() throws Exception { super.setUp(); @@ -358,7 +357,7 @@ DirectoryStringSyntax.DECODER, logMessages); if (taskState != TaskState.COMPLETED_SUCCESSFULLY && logMessages.size() == 0) logMessages.isEmpty()) { fail("No log messages were written to the task entry on a failed task"); } @@ -458,26 +457,23 @@ String[] entries = new String[entriesCnt + 2]; String filler = "000000000000000000000000000000000000"; entries[0] = new String( "dn: " + EXAMPLE_DN + "\n" entries[0] = "dn: " + EXAMPLE_DN + "\n" + "objectClass: top\n" + "objectClass: domain\n" + "dc: example\n" + "entryUUID: 21111111-1111-1111-1111-111111111111\n" + "\n"); entries[1] = new String( "dn: ou=People," + EXAMPLE_DN + "\n" + "\n"; entries[1] = "dn: ou=People," + EXAMPLE_DN + "\n" + "objectClass: top\n" + "objectClass: organizationalUnit\n" + "ou: People\n" + "entryUUID: 21111111-1111-1111-1111-111111111112\n" + "\n"); + "\n"; for (int i=0; i<entriesCnt; i++) { String useri="0000"+i; entries[i+2] = new String( "dn: cn="+useri+",ou=people," + EXAMPLE_DN + "\n" entries[i+2] = "dn: cn="+useri+",ou=people," + EXAMPLE_DN + "\n" + "objectclass: top\n" + "objectclass: person\n" + "objectclass: organizationalPerson\n" @@ -489,8 +485,8 @@ new String(bigAttributeValue).getBytes())+"\n" + "entryUUID: 21111111-1111-1111-1111-"+useri+ filler.substring(0, 12-useri.length())+"\n" + "\n"); }; + "\n"; } return entries; } @@ -510,8 +506,7 @@ String useri="0000"+entryCnt; return new String( "dn: cn="+useri+",ou=people," + EXAMPLE_DN + "\n" return "dn: cn="+useri+",ou=people," + EXAMPLE_DN + "\n" + "objectclass: top\n" + "objectclass: person\n" + "objectclass: organizationalPerson\n" @@ -523,7 +518,7 @@ new String(bigAttributeValue).getBytes())+"\n" + "entryUUID: 21111111-1111-1111-1111-"+useri+ filler.substring(0, 12-useri.length())+"\n" + "\n"); + "\n"; } @@ -665,8 +660,7 @@ */ private ReplicationServer createChangelogServer(int changelogId, String testCase) { SortedSet<String> servers = null; servers = new TreeSet<String>(); SortedSet<String> servers = new TreeSet<String>(); try { if (changelogId != changelog1ID)