From: <tho...@us...> - 2013-10-21 12:48:44
|
Revision: 7464 http://bigdata.svn.sourceforge.net/bigdata/?rev=7464&view=rev Author: thompsonbry Date: 2013-10-21 12:48:38 +0000 (Mon, 21 Oct 2013) Log Message: ----------- Creating a branch to address #718 (handling zk connection loss). Modified Paths: -------------- branches/ZK_DISCONNECT_HANDLING/bigdata/src/java/com/bigdata/quorum/AbstractQuorum.java branches/ZK_DISCONNECT_HANDLING/bigdata/src/test/com/bigdata/quorum/MockQuorumFixture.java branches/ZK_DISCONNECT_HANDLING/bigdata-jini/src/java/com/bigdata/journal/jini/ha/AbstractServer.java branches/ZK_DISCONNECT_HANDLING/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAClient.java branches/ZK_DISCONNECT_HANDLING/bigdata-jini/src/java/com/bigdata/zookeeper/ZooKeeperAccessor.java branches/ZK_DISCONNECT_HANDLING/bigdata-jini/src/test/com/bigdata/zookeeper/TestAll.java Added Paths: ----------- branches/ZK_DISCONNECT_HANDLING/ Property changes on: branches/ZK_DISCONNECT_HANDLING ___________________________________________________________________ Added: svn:ignore + ant-build src bin bigdata*.jar ant-release standalone test* countersfinal.xml events.jnl .settings *.jnl TestInsertRate.out SYSTAP-BBT-result.txt U10load+query *.hprof com.bigdata.cache.TestHardReferenceQueueWithBatchingUpdates.exp.csv commit-log.txt eventLog dist bigdata-test com.bigdata.rdf.stress.LoadClosureAndQueryTest.*.csv DIST.bigdata-*.tgz REL.bigdata-*.tgz queryLog* queryRunState* sparql.txt benchmark CI Added: svn:mergeinfo + /branches/BIGDATA_OPENRDF_2_6_9_UPDATE:6769-6785 /branches/BIGDATA_RELEASE_1_2_0:6766-7380 /branches/BTREE_BUFFER_BRANCH:2004-2045 /branches/DEV_BRANCH_27_OCT_2009:2270-2546,2548-2782 /branches/INT64_BRANCH:4486-4522 /branches/JOURNAL_HA_BRANCH:2596-4066 /branches/LARGE_LITERALS_REFACTOR:4175-4387 /branches/LEXICON_REFACTOR_BRANCH:2633-3304 /branches/QUADS_QUERY_BRANCH:4525-4531,4550-4584,4586-4609,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 /branches/READ_CACHE:7215-7271 /branches/RWSTORE_1_1_0_DEBUG:5896-5935 /branches/TIDS_PLUS_BLOBS_BRANCH:4814-4836 /branches/bugfix-btm:2594-3237 /branches/dev-btm:2574-2730 /branches/fko:3150-3194 /trunk:3392-3437,3656-4061 Modified: branches/ZK_DISCONNECT_HANDLING/bigdata/src/java/com/bigdata/quorum/AbstractQuorum.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/quorum/AbstractQuorum.java 2013-10-21 12:45:44 UTC (rev 7463) +++ branches/ZK_DISCONNECT_HANDLING/bigdata/src/java/com/bigdata/quorum/AbstractQuorum.java 2013-10-21 12:48:38 UTC (rev 7464) @@ -443,7 +443,7 @@ pipeline = new LinkedHashSet<UUID>(k * 2); } - + @Override protected void finalize() throws Throwable { terminate(); Modified: branches/ZK_DISCONNECT_HANDLING/bigdata/src/test/com/bigdata/quorum/MockQuorumFixture.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/test/com/bigdata/quorum/MockQuorumFixture.java 2013-10-21 12:45:44 UTC (rev 7463) +++ branches/ZK_DISCONNECT_HANDLING/bigdata/src/test/com/bigdata/quorum/MockQuorumFixture.java 2013-10-21 12:48:38 UTC (rev 7464) @@ -742,7 +742,7 @@ // Save UUID -> QuorumMember mapping on the fixture. fixture.known.put(client.getServiceId(), client); } - + @Override public void terminate() { final MockQuorumWatcher watcher = (MockQuorumWatcher) getWatcher(); super.terminate(); Modified: branches/ZK_DISCONNECT_HANDLING/bigdata-jini/src/java/com/bigdata/journal/jini/ha/AbstractServer.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/AbstractServer.java 2013-10-21 12:45:44 UTC (rev 7463) +++ branches/ZK_DISCONNECT_HANDLING/bigdata-jini/src/java/com/bigdata/journal/jini/ha/AbstractServer.java 2013-10-21 12:48:38 UTC (rev 7464) @@ -973,7 +973,7 @@ log.info("Creating service impl..."); // init. - impl = newService(config); + impl = newService(config); // FIXME Pass in the HAClient.Connection. if (log.isInfoEnabled()) log.info("Service impl is " + impl); @@ -1075,7 +1075,7 @@ * Simple representation of state (non-blocking, safe). Some fields reported * in the representation may be <code>null</code> depending on the server * state. - */ + */@Override public String toString() { // note: MAY be null. Modified: branches/ZK_DISCONNECT_HANDLING/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAClient.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAClient.java 2013-10-21 12:45:44 UTC (rev 7463) +++ branches/ZK_DISCONNECT_HANDLING/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAClient.java 2013-10-21 12:48:38 UTC (rev 7464) @@ -1128,7 +1128,7 @@ InterruptedException { /* - * Fast path. Check for an existing instance. + * Fast path. Check for an existing instance. FIXME MUst also verify that quorum is running. If terminated, then start(). But must also pass in the AbstractQuorumClient to be run if we are the HAJournalServer. Or let the caller start the quorum for their client rather than embedding that logic into this method. */ Quorum<HAGlue, QuorumClient<HAGlue>> quorum; synchronized (quorums) { Modified: branches/ZK_DISCONNECT_HANDLING/bigdata-jini/src/java/com/bigdata/zookeeper/ZooKeeperAccessor.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/zookeeper/ZooKeeperAccessor.java 2013-10-21 12:45:44 UTC (rev 7463) +++ branches/ZK_DISCONNECT_HANDLING/bigdata-jini/src/java/com/bigdata/zookeeper/ZooKeeperAccessor.java 2013-10-21 12:48:38 UTC (rev 7464) @@ -263,7 +263,7 @@ try { log.warn("Creating new client"); - + // FIXME must not create new zk while session not expired. zookeeper = new ZooKeeper(hosts, sessionTimeout, new ZooAliveWatcher()); @@ -331,7 +331,7 @@ if (zookeeper != null) { zookeeper.close(); - + // FIXME close must not clear the zk reference. only do this for session expired. zookeeper = null; } @@ -373,11 +373,12 @@ private class ZooAliveWatcher implements Watcher { private boolean connected = false; - + @Override public void process(final WatchedEvent e) { + System.err.println("event: "+e); + // FIXME Does not verify that event is for the current ZK client. + if(!open) return; // FIXME blocks view of events after a close(). - if(!open) return; - if (log.isInfoEnabled()) log.info(e.toString()); @@ -387,7 +388,7 @@ if(!open) return; - switch (e.getState()) { + switch (e.getState()) { // FIXME Review switch states. case Unknown: // @todo what to do with these events? @@ -428,7 +429,7 @@ } for (Watcher w : watchers) { - + System.err.println("send event: "+e); // send event to any registered watchers. w.process(e); Modified: branches/ZK_DISCONNECT_HANDLING/bigdata-jini/src/test/com/bigdata/zookeeper/TestAll.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/zookeeper/TestAll.java 2013-10-21 12:45:44 UTC (rev 7463) +++ branches/ZK_DISCONNECT_HANDLING/bigdata-jini/src/test/com/bigdata/zookeeper/TestAll.java 2013-10-21 12:48:38 UTC (rev 7464) @@ -49,6 +49,9 @@ final TestSuite suite = new TestSuite("zookeeper client library"); + // test suite for zookeeper session expiration semantics. + suite.addTestSuite(TestZookeeperSessionSemantics.class); + // test ability to handle an expired session. suite.addTestSuite(TestZookeeperAccessor.class); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |