From: <mar...@us...> - 2013-09-12 17:04:03
|
Revision: 7400 http://bigdata.svn.sourceforge.net/bigdata/?rev=7400&view=rev Author: martyncutcher Date: 2013-09-12 17:03:57 +0000 (Thu, 12 Sep 2013) Log Message: ----------- Change test teardown to better ensure a clean tidy of the test directories - removing HALog files, snapshots and journals. This will be more important as we extend service kill tests which previously would have resulted in potentially large numbers of files remaining. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3JournalServer.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java 2013-09-12 16:09:56 UTC (rev 7399) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java 2013-09-12 17:03:57 UTC (rev 7400) @@ -406,15 +406,15 @@ leaderListener = null; } - if (serverA != null && !serverA.equals(leader)) { + if (leader == null || !leader.equals(serverA)) { destroyA(); } - if (serverB != null && !serverB.equals(leader)) { + if (leader == null || !leader.equals(serverB)) { destroyB(); } - if (serverC != null && !serverC.equals(leader)) { + if (leader == null || !leader.equals(serverC)) { destroyC(); } @@ -676,8 +676,11 @@ protected void safeDestroy(final HAGlue haGlue, final File serviceDir, final ServiceListener serviceListener) { - if (haGlue == null) + if (haGlue == null) { + tidyServiceDirectory(serviceDir); // ensure empty + return; + } try { @@ -724,11 +727,29 @@ } } + + // try and ensure serviceDir is tidied in any event + // Remove *.jnl, HALog/*, snapshot/* + log.warn("Need to clear directory explicitly: " + serviceDir.getAbsolutePath()); + tidyServiceDirectory(serviceDir); } } - + + private void tidyServiceDirectory(final File serviceDir) { + if (serviceDir == null || !serviceDir.exists()) + return; + + for (File file : serviceDir.listFiles()) { + final String name = file.getName(); + + if (name.endsWith(".jnl") || name.equals("snapshot") || name.equals("HALog")) { + recursiveDelete(file); + } + } + } + /** * Some signals understood by Java. * @@ -827,6 +848,12 @@ serverC = null; serviceListenerC = null; } + + protected void kill(final HAGlue service) throws IOException { + final int pid = ((HAGlueTest) service).getPID(); + + trySignal(SignalEnum.KILL, pid); + } /** * NOTE: This relies on equals() being valid for Proxies which isn't @@ -1582,6 +1609,7 @@ } }); + return haGlue; } catch (Throwable t) { Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3JournalServer.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3JournalServer.java 2013-09-12 16:09:56 UTC (rev 7399) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3JournalServer.java 2013-09-12 17:03:57 UTC (rev 7400) @@ -1426,6 +1426,96 @@ } + public void testQuorumABC_killC() throws Exception { + + // Start 2 services. + final HAGlue serverA = startA(); + final HAGlue serverB = startB(); + + // Wait for a quorum meet. + final long token = quorum.awaitQuorum(awaitQuorumTimeout, + TimeUnit.MILLISECONDS); + +// // Verify KB exists. +// awaitKBExists(serverA); + + /* + * Note: The quorum was not fully met at the last 2-phase commit. + * Instead, 2 services participated in the 2-phase commit and the third + * service resynchronized when it came up and then went through a local + * commit. Therefore, the HALog files should exist on all nodes. + */ + + // Current commit point. + final long lastCommitCounter = 1; + + // Await initial commit point (KB create). + awaitCommitCounter(lastCommitCounter, serverA, serverB); + + /* + * Verify that HALog files were generated and are available for commit + * point ONE (1) on the services joined with the met quorum. + */ + assertHALogDigestsEquals(1L/* firstCommitCounter */, + lastCommitCounter, new HAGlue[] { serverA, serverB }); + + // Verify binary equality of (A,B) journals. + assertDigestsEquals(new HAGlue[] { serverA, serverB }); + + // Start 3rd service. + final HAGlue serverC = startC(); + + // Wait until the quorum is fully met. The token should not change. + assertEquals(token, awaitFullyMetQuorum()); + + // The commit counter has not changed. + assertEquals( + lastCommitCounter, + serverA.getRootBlock( + new HARootBlockRequest(null/* storeUUID */)) + .getRootBlock().getCommitCounter()); + + // HALog files now exist on ALL services. + assertHALogDigestsEquals(1L/* firstCommitCounter */, lastCommitCounter, + new HAGlue[] { serverA, serverB, serverC }); + + // Verify binary equality of ALL journals. + assertDigestsEquals(new HAGlue[] { serverA, serverB, serverC }); + + /* + * Now go through a commit point with a fully met quorum. The HALog + * files should be purged at that commit point. + */ + simpleTransaction(); + + // Current commit point. + final long lastCommitCounter2 = serverA + .getRootBlock(new HARootBlockRequest(null/* storeUUID */)) + .getRootBlock().getCommitCounter(); + + // There are TWO (2) commit points. + assertEquals(2L, lastCommitCounter2); + + // Verify binary equality of ALL journals. + assertDigestsEquals(new HAGlue[] { serverA, serverB, serverC }); + + // Verify no HALog files since fully met quorum @ commit. + assertHALogNotFound(0L/* firstCommitCounter */, lastCommitCounter, + new HAGlue[] { serverA, serverB, serverC }); + + // Now kill C - this will leave some file detritus + kill(serverC); + + // wait around to let the kill play out by waiting for [A, B] pipeline + awaitPipeline(new HAGlue[] {serverA, serverB}); + + // assert quorum remains met + assertTrue(quorum.isQuorumMet()); + + // ...and with original token + assertTrue(token == quorum.token()); + } + /** * Test quorum breaks and reforms when original leader fails * @@ -1463,6 +1553,42 @@ } /** + * Test quorum breaks and reforms when original leader fails + * + * @throws Exception + */ + public void testQuorumBreaksABC_killLeader() throws Exception { + + // Start 3 services in sequence + final ABC startup = new ABC(true/*sequential*/); + + // Wait for a quorum meet. + final long token = awaitMetQuorum(); + +// // Verify KB exists. +// awaitKBExists(startup.serverA); + + // Verify A is the leader. + assertEquals(startup.serverA, quorum.getClient().getLeader(token)); + + // Verify A is fully up. + awaitNSSAndHAReady(startup.serverA); + + // Now kill leader! + kill(startup.serverA); + + // Check that quorum meets around the remaining 2 services. + final long token2 = awaitNextQuorumMeet(token); + + // Verify that we have a new leader for the quorum. + final HAGlue leader = quorum.getClient().getLeader(token2); + + assertTrue(leader.equals(startup.serverB) + || leader.equals(startup.serverC)); + + } + + /** * Having observed stochastic failures, here is a stress test * to try and generate a more deterministic failure. * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2013-11-11 17:31:50
|
Revision: 7528 http://bigdata.svn.sourceforge.net/bigdata/?rev=7528&view=rev Author: thompsonbry Date: 2013-11-11 17:31:44 +0000 (Mon, 11 Nov 2013) Log Message: ----------- correctly raised the logger to FATAL to ignore ERROR messages for ill-formed literals. log4j.logger.com.bigdata.rdf.internal.LexiconConfiguration=FATAL Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/log4j-template-A.properties branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/log4j-template-B.properties branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/log4j-template-C.properties Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/log4j-template-A.properties =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/log4j-template-A.properties 2013-11-11 17:27:34 UTC (rev 7527) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/log4j-template-A.properties 2013-11-11 17:31:44 UTC (rev 7528) @@ -14,7 +14,7 @@ log4j.logger.com.bigdata.io.writecache=INFO #log4j.logger.com.bigdata.zookeeper=INFO #log4j.logger.com.bigdata.zookeeper.ZooHelper=ALL -com.bigdata.rdf.internal.LexiconConfiguration=FATAL +log4j.logger.com.bigdata.rdf.internal.LexiconConfiguration=FATAL log4j.appender.haLog=org.apache.log4j.FileAppender log4j.appender.haLog.Threshold=ALL Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/log4j-template-B.properties =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/log4j-template-B.properties 2013-11-11 17:27:34 UTC (rev 7527) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/log4j-template-B.properties 2013-11-11 17:31:44 UTC (rev 7528) @@ -14,7 +14,7 @@ #log4j.logger.com.bigdata.io.writecache=INFO #log4j.logger.com.bigdata.zookeeper=INFO #log4j.logger.com.bigdata.zookeeper.ZooHelper=ALL -com.bigdata.rdf.internal.LexiconConfiguration=FATAL +log4j.logger.com.bigdata.rdf.internal.LexiconConfiguration=FATAL log4j.appender.haLog=org.apache.log4j.FileAppender log4j.appender.haLog.Threshold=ALL Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/log4j-template-C.properties =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/log4j-template-C.properties 2013-11-11 17:27:34 UTC (rev 7527) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/log4j-template-C.properties 2013-11-11 17:31:44 UTC (rev 7528) @@ -14,7 +14,7 @@ #log4j.logger.com.bigdata.io.writecache=INFO #log4j.logger.com.bigdata.zookeeper=INFO #log4j.logger.com.bigdata.zookeeper.ZooHelper=ALL -com.bigdata.rdf.internal.LexiconConfiguration=FATAL +log4j.logger.com.bigdata.rdf.internal.LexiconConfiguration=FATAL log4j.appender.haLog=org.apache.log4j.FileAppender log4j.appender.haLog.Threshold=ALL This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2013-11-11 18:33:00
|
Revision: 7529 http://bigdata.svn.sourceforge.net/bigdata/?rev=7529&view=rev Author: thompsonbry Date: 2013-11-11 18:32:53 +0000 (Mon, 11 Nov 2013) Log Message: ----------- Modified destroyAll() to provide more information if leader is none of A, B, or C. Removed explicit destroyAll() call from testABCMultiLoadFollowerReadsLargeLoad(). Not required. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3JournalServer.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java 2013-11-11 17:31:44 UTC (rev 7528) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java 2013-11-11 18:32:53 UTC (rev 7529) @@ -468,8 +468,11 @@ } else if (leader.equals(serverC)) { leaderServiceDir = getServiceDirC(); leaderListener = serviceListenerC; - } else { - throw new IllegalStateException(); + } else {// log warning and fall through. + throw new IllegalStateException( + "Leader is none of A, B, or C: leader=" + leader + + ", A=" + serverA + ", B=" + serverB + ", C=" + + serverC); } } else { leader = null; @@ -531,6 +534,7 @@ final UUID[] services = getServices(members); assertCondition(new Runnable() { + @Override public void run() { try { assertEquals(services, quorum.getPipeline()); @@ -570,6 +574,7 @@ final UUID[] services = getServices(members); assertCondition(new Runnable() { + @Override public void run() { try { assertEquals(services, quorum.getJoined()); @@ -594,6 +599,7 @@ final UUID[] services = getServices(members); assertCondition(new Runnable() { + @Override public void run() { try { assertEquals(services, quorum.getMembers()); @@ -855,15 +861,16 @@ } private void tidyServiceDirectory(final File serviceDir) { - if (serviceDir == null || !serviceDir.exists()) - return; - + if (serviceDir == null || !serviceDir.exists()) + return; + for (File file : serviceDir.listFiles()) { - final String name = file.getName(); - - if (name.endsWith(".jnl") || name.equals("snapshot") || name.equals("HALog")) { - recursiveDelete(file); - } + final String name = file.getName(); + + if (name.endsWith(".jnl") || name.equals("snapshot") + || name.equals("HALog")) { + recursiveDelete(file); + } } } @@ -928,48 +935,50 @@ } protected void destroyA() { - safeDestroy(serverA, getServiceDirA(), serviceListenerA); - serverA = null; - serviceListenerA = null; + safeDestroy(serverA, getServiceDirA(), serviceListenerA); + serverA = null; + serviceListenerA = null; } protected void destroyB() { - safeDestroy(serverB, getServiceDirB(), serviceListenerB); - serverB = null; - serviceListenerB = null; + safeDestroy(serverB, getServiceDirB(), serviceListenerB); + serverB = null; + serviceListenerB = null; } protected void destroyC() { - safeDestroy(serverC, getServiceDirC(), serviceListenerC); - serverC = null; - serviceListenerC = null; + safeDestroy(serverC, getServiceDirC(), serviceListenerC); + serverC = null; + serviceListenerC = null; } protected void shutdownA() throws IOException { - safeShutdown(serverA, getServiceDirA(), serviceListenerA, true); - - serverA = null; - serviceListenerA = null; + safeShutdown(serverA, getServiceDirA(), serviceListenerA, true); + + serverA = null; + serviceListenerA = null; } - + protected void shutdownB() throws IOException { - safeShutdown(serverB, getServiceDirB(), serviceListenerB, true); - - serverB = null; - serviceListenerB = null; + safeShutdown(serverB, getServiceDirB(), serviceListenerB, true); + + serverB = null; + serviceListenerB = null; } - + protected void shutdownC() throws IOException { - safeShutdown(serverC, getServiceDirC(), serviceListenerC, true); - - serverC = null; - serviceListenerC = null; + safeShutdown(serverC, getServiceDirC(), serviceListenerC, true); + + serverC = null; + serviceListenerC = null; } - + protected void kill(final HAGlue service) throws IOException { + final int pid = ((HAGlueTest) service).getPID(); - + trySignal(SignalEnum.KILL, pid); + } /** @@ -977,19 +986,20 @@ * necessarily something we should rely on */ protected void shutdown(final HAGlue service) throws IOException { - if (service == null) { - throw new IllegalArgumentException(); - } - - if (service.equals(serverA)) { - shutdownA(); - } else if (service.equals(serverB)) { - shutdownB(); - } else if (service.equals(serverC)) { - shutdownC(); - } else { - throw new IllegalArgumentException("Unable to match service: " + service + " possible problem with equals() on Proxy"); - } + if (service == null) { + throw new IllegalArgumentException(); + } + + if (service.equals(serverA)) { + shutdownA(); + } else if (service.equals(serverB)) { + shutdownB(); + } else if (service.equals(serverC)) { + shutdownC(); + } else { + throw new IllegalArgumentException("Unable to match service: " + + service + " possible problem with equals() on Proxy"); + } } protected void shutdownLeader() throws AsynchronousQuorumCloseException, @@ -1028,6 +1038,7 @@ } + @Override public Void call() { safeShutdown(haGlue, serviceDir, serviceListener, now); @@ -1133,6 +1144,7 @@ final File serviceDir, final ServiceListener serviceListener) { assertCondition(new Runnable() { + @Override public void run() { try { haGlue.getRunState(); @@ -1145,6 +1157,7 @@ }); assertCondition(new Runnable() { + @Override public void run() { // try to discover the service item. @@ -1164,6 +1177,7 @@ try { assertCondition(new Runnable() { + @Override public void run() { // Wait for the process death. assertTrue(serviceListener.isDead()); @@ -1517,6 +1531,7 @@ } + @Override public HAGlue call() throws Exception { if (restart) { @@ -1542,6 +1557,7 @@ } + @Override public HAGlue call() throws Exception { if (restart) { @@ -1567,6 +1583,7 @@ } + @Override public HAGlue call() throws Exception { if (restart) { @@ -1621,15 +1638,15 @@ } protected UUID getServiceAId() { - return serverAId; + return serverAId; } - + protected UUID getServiceBId() { - return serverBId; + return serverBId; } - + protected UUID getServiceCId() { - return serverCId; + return serverCId; } private HAGlue startServer(final String name, Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3JournalServer.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3JournalServer.java 2013-11-11 17:31:44 UTC (rev 7528) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3JournalServer.java 2013-11-11 18:32:53 UTC (rev 7529) @@ -2360,19 +2360,25 @@ } /** - * Similar to multitransaction but rather than a number of updates following a load it is simply a number of loads - * followed by queries on the folowers that are checkd for consistency. + * Similar to multitransaction but rather than a number of updates following + * a load it is simply a number of loads followed by queries on the folowers + * that are checkd for consistency. */ public void testABCMultiLoadFollowerReads() throws Exception { - doABCMultiLoadFollowerReads2(50/*nTransactions*/, false/*largeLoad*/); + + doABCMultiLoadFollowerReads2(50/* nTransactions */, false/* largeLoad */); + } - + /** - * Similar to multitransaction but rather than a number of updates following a load it is simply a number of loads - * followed by queries on the folowers that are checkd for consistency. + * Similar to multitransaction but rather than a number of updates following + * a load it is simply a number of loads followed by queries on the folowers + * that are checkd for consistency. */ public void testABCMultiLoadFollowerReadsLargeLoad() throws Exception { - doABCMultiLoadFollowerReads2(20/*nTransactions*/, true/*largeLoad*/); + + doABCMultiLoadFollowerReads2(20/* nTransactions */, true/* largeLoad */); + } /** @@ -2386,7 +2392,7 @@ protected void doABCMultiLoadFollowerReads2(final int nTransactions, final boolean largeLoad) throws Exception { - try { +// try { // Start all services. final ABC services = new ABC(true/* sequential */); @@ -2515,11 +2521,11 @@ // Finally cehck for binary compatibility assertDigestsEquals(new HAGlue[] { services.serverA, services.serverB, services.serverC }); - } finally { - - destroyAll(); - - } +// } finally { +// +// destroyAll(); +// +// } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2013-11-13 17:23:35
|
Revision: 7542 http://bigdata.svn.sourceforge.net/bigdata/?rev=7542&view=rev Author: thompsonbry Date: 2013-11-13 17:23:29 +0000 (Wed, 13 Nov 2013) Log Message: ----------- cleanup in HAJournal-X.config and jiniClient.config files for HA CI (jini and zookeeper stuff that was commented out was removed as irrelevant to CI). Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-A.config branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-B.config branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-C.config branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/jiniClient.config Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-A.config =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-A.config 2013-11-13 17:22:34 UTC (rev 7541) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-A.config 2013-11-13 17:23:29 UTC (rev 7542) @@ -98,10 +98,6 @@ // runs jini on the localhost using unicast locators. new LookupLocator("jini://localhost/") - - // runs jini on one or more hosts using unicast locators. - //new LookupLocator("jini://"+jini1), - //new LookupLocator("jini://"+jini2), }; @@ -174,11 +170,6 @@ */ // standalone. servers = "localhost:2081"; - // ensemble -// servers = bigdata.zoo1+":2181" -// + ","+bigdata.zoo2+":2181" -// + ","+bigdata.zoo3+":2181" -// ; /* Session timeout (optional). */ sessionTimeout = bigdata.sessionTimeout; Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-B.config =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-B.config 2013-11-13 17:22:34 UTC (rev 7541) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-B.config 2013-11-13 17:23:29 UTC (rev 7542) @@ -98,10 +98,6 @@ // runs jini on the localhost using unicast locators. new LookupLocator("jini://localhost/") - - // runs jini on one or more hosts using unicast locators. - //new LookupLocator("jini://"+jini1), - //new LookupLocator("jini://"+jini2), }; @@ -174,11 +170,6 @@ */ // standalone. servers = "localhost:2081"; - // ensemble -// servers = bigdata.zoo1+":2181" -// + ","+bigdata.zoo2+":2181" -// + ","+bigdata.zoo3+":2181" -// ; /* Session timeout (optional). */ sessionTimeout = bigdata.sessionTimeout; Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-C.config =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-C.config 2013-11-13 17:22:34 UTC (rev 7541) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-C.config 2013-11-13 17:23:29 UTC (rev 7542) @@ -98,10 +98,6 @@ // runs jini on the localhost using unicast locators. new LookupLocator("jini://localhost/") - - // runs jini on one or more hosts using unicast locators. - //new LookupLocator("jini://"+jini1), - //new LookupLocator("jini://"+jini2), }; @@ -174,11 +170,6 @@ */ // standalone. servers = "localhost:2081"; - // ensemble -// servers = bigdata.zoo1+":2181" -// + ","+bigdata.zoo2+":2181" -// + ","+bigdata.zoo3+":2181" -// ; /* Session timeout (optional). */ sessionTimeout = bigdata.sessionTimeout; Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/jiniClient.config =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/jiniClient.config 2013-11-13 17:22:34 UTC (rev 7541) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/jiniClient.config 2013-11-13 17:23:29 UTC (rev 7542) @@ -26,10 +26,6 @@ // runs jini on the localhost using unicast locators. new LookupLocator("jini://localhost/") - - // runs jini on one or more hosts using unicast locators. - //new LookupLocator("jini://"+jini1), - //new LookupLocator("jini://"+jini2), }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2013-11-13 17:33:56
|
Revision: 7543 http://bigdata.svn.sourceforge.net/bigdata/?rev=7543&view=rev Author: martyncutcher Date: 2013-11-13 17:33:49 +0000 (Wed, 13 Nov 2013) Log Message: ----------- Adds ChangeLeader test to force a simple change of quorum leadership that demonstrated the failure mode first observed with #738 and now fixed. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestAll.java Added Paths: ----------- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3ChangeLeader.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestAll.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestAll.java 2013-11-13 17:23:29 UTC (rev 7542) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestAll.java 2013-11-13 17:33:49 UTC (rev 7543) @@ -100,6 +100,9 @@ // HA3 test suite in which normal HALog retention rules apply. suite.addTestSuite(TestHA3JournalServerWithHALogs.class); + // HA3 test suite focusing on changing the leader. + suite.addTestSuite(TestHA3ChangeLeader.class); + // HA3 snapshot policy test suite. suite.addTestSuite(TestHA3SnapshotPolicy.class); suite.addTestSuite(TestHA3SnapshotPolicy2.class); Added: branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3ChangeLeader.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3ChangeLeader.java (rev 0) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3ChangeLeader.java 2013-11-13 17:33:49 UTC (rev 7543) @@ -0,0 +1,48 @@ +package com.bigdata.journal.jini.ha; + +import java.util.concurrent.TimeUnit; + +import com.bigdata.ha.HAGlue; + +public class TestHA3ChangeLeader extends AbstractHA3JournalServerTestCase { + + /** + * We have seen problems with updates when the leader changes, this test reconstructs + * this simple scenario, with and update transaction, change of leader and then a + * second update transaction. + * + * @throws Exception + */ + public void testStartABC_ChangeLeader() throws Exception { + + // Start 3 services + final HAGlue serverA = startA(); + final HAGlue serverB = startB(); + final HAGlue serverC = startC(); + + // Wait for a quorum meet. + final long token1 = awaitFullyMetQuorum(); + + // await pipeline + awaitPipeline(20, TimeUnit.SECONDS, new HAGlue[] { serverA, serverB, + serverC }); + + awaitCommitCounter(1L, new HAGlue[] { serverA, serverB, serverC }); + + /* + * Now go through a commit point with a met quorum. The HALog + * files should be retained at that commit point. + */ + simpleTransaction(); + + shutdownA(); + + final long token2 = awaitNextQuorumMeet(token1); + + simpleTransaction(); + + // And again verify binary equality of ALL journals. + assertDigestsEquals(new HAGlue[] { serverB, serverC }); + + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2013-12-18 16:41:17
|
Revision: 7675 http://bigdata.svn.sourceforge.net/bigdata/?rev=7675&view=rev Author: thompsonbry Date: 2013-12-18 16:41:11 +0000 (Wed, 18 Dec 2013) Log Message: ----------- Disabling some known bad tests for the 1.3.0 release. These are linked to BigdataStatics.runKnownBadTests Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3ChangeLeader.java branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHAJournalServerOverride.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3ChangeLeader.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3ChangeLeader.java 2013-12-18 15:21:37 UTC (rev 7674) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3ChangeLeader.java 2013-12-18 16:41:11 UTC (rev 7675) @@ -92,7 +92,12 @@ } public void testStartABC_KillLeader_RandomTrans() throws Exception { - if(BigdataStatics.runKnownBadTests)return; + if (!BigdataStatics.runKnownBadTests) { + /* + * FIXME Test disabled for the 1.3.0 release. + */ + return; + } fail("Test disabled pending reconcilation of socket ticket"); final Random r = new Random(); final int ntrans = r.nextInt(900); Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHAJournalServerOverride.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHAJournalServerOverride.java 2013-12-18 15:21:37 UTC (rev 7674) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHAJournalServerOverride.java 2013-12-18 16:41:11 UTC (rev 7675) @@ -35,6 +35,7 @@ import org.apache.zookeeper.ZooKeeper; +import com.bigdata.BigdataStatics; import com.bigdata.ha.HACommitGlue; import com.bigdata.ha.HAGlue; import com.bigdata.ha.HAStatusEnum; @@ -1614,12 +1615,16 @@ * service) will accept new transactions. There could be a race here between * a fully met quorum and new transactions, but eventually all services will * be joined with the met quorum and at the same commit point. - * - * FIXME This test fails. Figure out why. */ public void testABC_stopZookeeper_failA_startZookeeper_quorumMeetsAgainOnNewToken() throws Exception { - + if (!BigdataStatics.runKnownBadTests) { + /* + * FIXME Test disabled for the 1.3.0 release. This test fails. + * Figure out why. + */ + return; + } final HAGlue serverA = startA(); final HAGlue serverB = startB(); final HAGlue serverC = startC(); @@ -1735,11 +1740,19 @@ * transaction. This should push A into an error state. When we restart * zookeeper the quorum should break and then reform (in some arbitrary) * order. Services should be at the last recorded commit point. New - * transactions should be accepted. FIXME Test fails. Figure out why. + * transactions should be accepted. */ public void testAB_stopZookeeper_failB_startZookeeper_quorumBreaksThenMeets() throws Exception { + if (!BigdataStatics.runKnownBadTests) { + /* + * FIXME Test disabled for the 1.3.0 release. This test fails. + * Figure out why. + */ + return; + } + final HAGlue serverA = startA(); final HAGlue serverB = startB(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-04-07 13:01:43
|
Revision: 8073 http://sourceforge.net/p/bigdata/code/8073 Author: thompsonbry Date: 2014-04-07 13:01:39 +0000 (Mon, 07 Apr 2014) Log Message: ----------- Added a simple test to verify that all joined services accept a CANCEL request. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestAll.java Added Paths: ----------- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3CancelQuery.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestAll.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestAll.java 2014-04-07 12:57:15 UTC (rev 8072) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestAll.java 2014-04-07 13:01:39 UTC (rev 8073) @@ -99,6 +99,9 @@ // // Test suite for the global write lock. // suite.addTestSuite(TestHAJournalServerGlobalWriteLock.class); + // Test suite for issuing a CANCEL request for Query or Update. + suite.addTestSuite(TestHA3CancelQuery.class); + // Test suite for utility to compute and compare HALog digests. suite.addTestSuite(TestHA3DumpLogs.class); Added: branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3CancelQuery.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3CancelQuery.java (rev 0) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3CancelQuery.java 2014-04-07 13:01:39 UTC (rev 8073) @@ -0,0 +1,129 @@ +/** + +Copyright (C) SYSTAP, LLC 2006-2007. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +/* + * Created on Oct 31, 2012 + */ +package com.bigdata.journal.jini.ha; + +import java.util.UUID; + +import net.jini.config.Configuration; + +import com.bigdata.ha.HAGlue; +import com.bigdata.ha.HAStatusEnum; +import com.bigdata.journal.AbstractJournal; +import com.bigdata.quorum.Quorum; +import com.bigdata.rdf.sail.webapp.client.RemoteRepository; + +/** + * Test suites for an {@link HAJournalServer} quorum with a replication factor + * of THREE (3) and a fully met {@link Quorum}. + * + * TODO Do we have any guards against rolling back a service in RESYNC if the + * other services are more than 2 commit points before it? We probably should + * not automatically roll it back to the other services in this case, but that + * could also reduce the ergonomics of the HA3 configuration. + * + * TODO All of these live load remains met tests could also be done with BOUNCE + * rather than SHUTDOWN/RESTART. BOUNCE exercises different code paths and + * corresponds to a zookeeper timeout, e.g., as might occur during a full GC + * pause. + * + * TODO Update the existing tests to verify that the quorum token is properly + * set on C when C resyncs with A+B and that + * {@link AbstractJournal#getHAReady()} reports the correct token. This tests + * for a problem where we did not call setQuorumToken() again when we resync and + * transition into the met quorum. This meant that the HAReady token is not set + * for a service unless it is part of the initial quorum meet. One of the HA3 + * backup tests covers this, but we should be checking the HAReadyToken in this + * test suite as well. + * + * @author <a href="mailto:tho...@us...">Bryan Thompson</a> + */ +public class TestHA3CancelQuery extends AbstractHA3JournalServerTestCase { + + /** + * {@inheritDoc} + * <p> + * Note: This overrides some {@link Configuration} values for the + * {@link HAJournalServer} in order to establish conditions suitable for + * testing the {@link ISnapshotPolicy} and {@link IRestorePolicy}. + */ + @Override + protected String[] getOverrides() { + + return new String[]{ +// "com.bigdata.journal.HAJournal.properties=" +TestHA3JournalServer.getTestHAJournalProperties(com.bigdata.journal.HAJournal.properties), + "com.bigdata.journal.jini.ha.HAJournalServer.restorePolicy=new com.bigdata.journal.jini.ha.DefaultRestorePolicy(0L,1,0)", + "com.bigdata.journal.jini.ha.HAJournalServer.snapshotPolicy=new com.bigdata.journal.jini.ha.NoSnapshotPolicy()", +// "com.bigdata.journal.jini.ha.HAJournalServer.HAJournalClass=\""+HAJournalTest.class.getName()+"\"", +// "com.bigdata.journal.jini.ha.HAJournalServer.onlineDisasterRecovery=true", + }; + + } + + public TestHA3CancelQuery() { + } + + public TestHA3CancelQuery(String name) { + super(name); + } + + /** + * Starts 3 services in a known order. The leader will be A. The pipeline + * order will be A, B, C. Issues cancel request to each of the services and + * verifies that all services are willing to accept a POST of the CANCEL + * request. + */ + public void test_ABC_CancelQuery() throws Exception { + + final ABC abc = new ABC(true/*sequential*/); + + final HAGlue serverA = abc.serverA, serverB = abc.serverB, serverC = abc.serverC; + + // Verify quorum is FULLY met. + awaitFullyMetQuorum(); + + // await the KB create commit point to become visible on each service. + awaitCommitCounter(1L, new HAGlue[] { serverA, serverB, serverC }); + + // get RemoteRepository for each service. + final RemoteRepository[] repo = new RemoteRepository[3]; + + repo[0] = getRemoteRepository(serverA); + repo[1] = getRemoteRepository(serverB); + repo[2] = getRemoteRepository(serverC); + + // Verify leader vs followers. + assertEquals(HAStatusEnum.Leader, serverA.getHAStatus()); + assertEquals(HAStatusEnum.Follower, serverB.getHAStatus()); + assertEquals(HAStatusEnum.Follower, serverC.getHAStatus()); + + repo[0].cancel(UUID.randomUUID()); + repo[1].cancel(UUID.randomUUID()); + repo[2].cancel(UUID.randomUUID()); + + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-06-16 22:10:34
|
Revision: 8491 http://sourceforge.net/p/bigdata/code/8491 Author: tobycraig Date: 2014-06-16 22:10:27 +0000 (Mon, 16 Jun 2014) Log Message: ----------- Added test for HA1 with LBS Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA1JournalServer.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java 2014-06-16 21:12:25 UTC (rev 8490) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java 2014-06-16 22:10:27 UTC (rev 8491) @@ -2807,6 +2807,25 @@ } /** + * Commits update transaction with LBS after awaiting quorum. + */ + protected void simpleTransactionLBS() throws IOException, Exception { + + // Await quorum meet. + final long token = quorum.awaitQuorum(awaitQuorumTimeout, + TimeUnit.MILLISECONDS); + + // Figure out which service is the leader. + final HAGlue leader = quorum.getClient().getLeader(token); + + // Wait until that service is ready to act as the leader. + assertEquals(HAStatusEnum.Leader, awaitNSSAndHAReady(leader)); + + simpleTransaction_noQuorumCheckLBS(leader); + + } + + /** * Immediately issues a simple transaction against the service. * * @param leader @@ -2823,6 +2842,22 @@ } /** + * Immediately issues a simple transaction against the service with LBS. + * + * @param leader + * The service (must be the leader to succeed). + * + * @throws IOException + * @throws Exception + */ + protected void simpleTransaction_noQuorumCheckLBS(final HAGlue leader) + throws IOException, Exception { + + simpleTransaction_noQuorumCheck(leader, true/* useLoadBalancer */); + + } + + /** * Immediately issues a simple transaction against the service. * * @param haGlue Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA1JournalServer.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA1JournalServer.java 2014-06-16 21:12:25 UTC (rev 8490) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA1JournalServer.java 2014-06-16 22:10:27 UTC (rev 8491) @@ -123,6 +123,19 @@ } + public void testSimpleTransactionLBS() throws Exception { + + doStartA(); + + serverA.awaitHAReady(2, TimeUnit.SECONDS); + + awaitCommitCounter(1, new HAGlue[] { serverA }); + + simpleTransactionLBS(); + + awaitCommitCounter(2, new HAGlue[] { serverA }); + } + public void testMultiTransaction() throws Exception { doStartA(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |