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. |