From commits-return-14823-apmail-directory-commits-archive=directory.apache.org@directory.apache.org Thu Aug 02 19:21:33 2007 Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 63214 invoked from network); 2 Aug 2007 19:21:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Aug 2007 19:21:32 -0000 Received: (qmail 74899 invoked by uid 500); 2 Aug 2007 19:21:32 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 74851 invoked by uid 500); 2 Aug 2007 19:21:32 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 74840 invoked by uid 99); 2 Aug 2007 19:21:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Aug 2007 12:21:32 -0700 X-ASF-Spam-Status: No, hits=-98.8 required=10.0 tests=ALL_TRUSTED,FS_REPLICA X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Aug 2007 19:21:31 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 74DA01A981A; Thu, 2 Aug 2007 12:21:11 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r562225 - in /directory/apacheds/trunk/mitosis/src: main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationServerContextHandler.java test/java/org/apache/directory/mitosis/service/ReplicationServiceITest.java Date: Thu, 02 Aug 2007 19:21:11 -0000 To: commits@directory.apache.org From: malderson@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070802192111.74DA01A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: malderson Date: Thu Aug 2 12:21:09 2007 New Revision: 562225 URL: http://svn.apache.org/viewvc?view=rev&rev=562225 Log: Re-committing 560042: "Fixed DIRSERVER-895, where a server will never accept replication logs until it is restarted if a connection is closed during a replication transaction (e.g. due to a message timeout). No test for this yet as other issues would prevent it from being reliable." Hopefully the fix for DIRSERVER-998 will have made the test stable. Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationServerContextHandler.java directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/ReplicationServiceITest.java Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationServerContextHandler.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationServerContextHandler.java?view=diff&rev=562225&r1=562224&r2=562225 ============================================================================== --- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationServerContextHandler.java (original) +++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationServerContextHandler.java Thu Aug 2 12:21:09 2007 @@ -69,7 +69,7 @@ public synchronized void contextEnd( ReplicationContext ctx ) throws Exception { // Reset the mark if the context has the unfinished transaction. - if ( !ctx.getPeer().equals( replicaInTransaction ) ) + if ( ctx.getPeer() != null && ctx.getPeer().equals( replicaInTransaction ) ) { replicaInTransaction = null; } Modified: directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/ReplicationServiceITest.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/ReplicationServiceITest.java?view=diff&rev=562225&r1=562224&r2=562225 ============================================================================== --- directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/ReplicationServiceITest.java (original) +++ directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/ReplicationServiceITest.java Thu Aug 2 12:21:09 2007 @@ -80,10 +80,12 @@ public void testOneWay() throws Exception { - String dn = "cn=test,ou=system"; - testOneWayBind( dn ); - testOneWayModify( dn ); - testOneWayUnbind( dn ); + String dn1 = "cn=test,ou=system"; +// String dn2 = "cn=test2,ou=system"; + testOneWayBind( dn1 ); + testOneWayModify( dn1 ); +// testOneWayRename( dn1, dn2 ); + testOneWayUnbind( dn1 ); } /** @@ -168,6 +170,26 @@ Assert.assertEquals( newValue, getAttributeValue( ctxB, dn, "ou" ) ); Assert.assertEquals( newValue, getAttributeValue( ctxC, dn, "ou" ) ); } + +// private void testOneWayRename( String dn1, String dn2 ) throws Exception +// { +// LdapContext ctxA = getReplicaContext( "A" ); +// LdapContext ctxB = getReplicaContext( "B" ); +// LdapContext ctxC = getReplicaContext( "C" ); +// +// ctxA.rename( dn1, dn2 ); +// +// replicationServices.get( "A" ).replicate(); +// +// Thread.sleep( 5000 ); +// +// assertNotExists( ctxA, dn1 ); +// assertNotExists( ctxB, dn1 ); +// assertNotExists( ctxC, dn1 ); +// Assert.assertNotNull( ctxA.lookup( dn2 ) ); +// Assert.assertNotNull( ctxB.lookup( dn2 ) ); +// Assert.assertNotNull( ctxC.lookup( dn2 ) ); +// } private void testOneWayUnbind( String dn ) throws Exception { @@ -289,7 +311,7 @@ { i.next().interruptConnectors(); } - Thread.sleep( 1000 ); + Thread.sleep( 5000 ); } private LdapContext getReplicaContext( String name ) throws Exception