accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [04/16] git commit: ACCUMULO-2334 Make a slightly better ZK check for the mid-1.5.1-SNAPSHOT state.
Date Tue, 11 Feb 2014 18:41:45 GMT
ACCUMULO-2334 Make a slightly better ZK check for the mid-1.5.1-SNAPSHOT state.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/fd31595b
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/fd31595b
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/fd31595b

Branch: refs/heads/1.5.1-SNAPSHOT
Commit: fd31595b55f66627cf6d64cb20cc874c04e9da58
Parents: 0351d0d
Author: Josh Elser <elserj@apache.org>
Authored: Tue Feb 11 12:04:39 2014 -0500
Committer: Josh Elser <elserj@apache.org>
Committed: Tue Feb 11 12:04:39 2014 -0500

----------------------------------------------------------------------
 .../java/org/apache/accumulo/server/monitor/Monitor.java    | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/fd31595b/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java b/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java
index b33d9e3..00bd3ca 100644
--- a/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java
+++ b/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java
@@ -562,11 +562,18 @@ public class Monitor {
         // And then make the nodes that we expect for the incoming ephemeral nodes
         zoo.putPersistentData(monitorPath, new byte[0], NodeExistsPolicy.FAIL);
         zoo.putPersistentData(monitorLockPath, new byte[0], NodeExistsPolicy.FAIL);
+      } else if (!zoo.exists(monitorLockPath)) {
+        // monitor node in ZK exists and is empty as we expect
+        // but the monitor/lock node does not
+        zoo.putPersistentData(monitorLockPath, new byte[0], NodeExistsPolicy.FAIL);
       }
     } else {
       // 1.5.0 and earlier
       zoo.putPersistentData(zRoot + Constants.ZMONITOR, new byte[0], NodeExistsPolicy.FAIL);
-      zoo.putPersistentData(zRoot + Constants.ZMONITOR_LOCK, new byte[0], NodeExistsPolicy.FAIL);
+      if (!zoo.exists(monitorLockPath)) {
+        // Somehow the monitor node exists but not monitor/lock
+        zoo.putPersistentData(monitorLockPath, new byte[0], NodeExistsPolicy.FAIL);
+      }
     }
 
     // Get a ZooLock for the monitor


Mime
View raw message