Author: ecn
Date: Tue Apr 2 20:19:15 2013
New Revision: 1463735
URL: http://svn.apache.org/r1463735
Log:
ACCUMULO-1233 retry znode child scans
Modified:
accumulo/trunk/ (props changed)
accumulo/trunk/assemble/ (props changed)
accumulo/trunk/core/ (props changed)
accumulo/trunk/examples/ (props changed)
accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
(contents, props changed)
accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
(props changed)
accumulo/trunk/server/ (props changed)
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java
accumulo/trunk/src/ (props changed)
Propchange: accumulo/trunk/
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5:r1463734
Propchange: accumulo/trunk/assemble/
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5/assemble:r1463734
Propchange: accumulo/trunk/core/
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5/core:r1463734
Propchange: accumulo/trunk/examples/
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5/examples:r1463734
Modified:
accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
URL:
http://svn.apache.org/viewvc/accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java?rev=1463735&r1=1463734&r2=1463735&view=diff
==============================================================================
--- accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
(original)
+++ accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
Tue Apr 2 20:19:15 2013
@@ -250,16 +250,20 @@ public class ZooStore<T> implements TSto
public Repo<T> top(long tid) {
verifyReserved(tid);
- try {
- String txpath = getTXPath(tid);
- String top = findTop(txpath);
- if (top == null)
- return null;
-
- byte[] ser = zk.getData(txpath + "/" + top, null);
- return (Repo<T>) deserialize(ser);
- } catch (Exception e) {
- throw new RuntimeException(e);
+ while (true) {
+ try {
+ String txpath = getTXPath(tid);
+ String top = findTop(txpath);
+ if (top == null)
+ return null;
+
+ byte[] ser = zk.getData(txpath + "/" + top, null);
+ return (Repo<T>) deserialize(ser);
+ } catch (KeeperException.NoNodeException ex) {
+ continue;
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
}
}
Propchange:
accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
------------------------------------------------------------------------------
Merged
/accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java:r1463734
Propchange:
accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
------------------------------------------------------------------------------
Merged
/accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java:r1463734
Propchange: accumulo/trunk/server/
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5/server:r1463734
Modified:
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java
URL:
http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java?rev=1463735&r1=1463734&r2=1463735&view=diff
==============================================================================
---
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java
(original)
+++
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java
Tue Apr 2 20:19:15 2013
@@ -892,10 +892,20 @@ public class MetadataTable extends org.a
private static void getRootLogEntries(ArrayList<LogEntry> result) throws
KeeperException, InterruptedException, IOException {
IZooReaderWriter zoo = ZooReaderWriter.getInstance();
String root = getZookeeperLogLocation();
- for (String child : zoo.getChildren(root)) {
- LogEntry e = new LogEntry();
- e.fromBytes(zoo.getData(root + "/" + child, null));
- result.add(e);
+ // there's a little race between getting the children and fetching
+ // the data. The log can be removed in between.
+ while (true) {
+ result.clear();
+ for (String child : zoo.getChildren(root)) {
+ LogEntry e = new LogEntry();
+ try {
+ e.fromBytes(zoo.getData(root + "/" + child, null));
+ result.add(e);
+ } catch (KeeperException.NoNodeException ex) {
+ continue;
+ }
+ }
+ break;
}
}
Propchange: accumulo/trunk/src/
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5/src:r1463734