hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject [4/4] hbase git commit: HBASE-13885 ZK watches leaks during snapshots.
Date Tue, 16 Jun 2015 19:25:05 GMT
HBASE-13885 ZK watches leaks during snapshots.


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

Branch: refs/heads/branch-1.1
Commit: d7b56f631d1fe2a180746b134696d20e4617df2d
Parents: 5d26dec
Author: Lars Hofhansl <larsh@apache.org>
Authored: Tue Jun 16 12:21:49 2015 -0700
Committer: Lars Hofhansl <larsh@apache.org>
Committed: Tue Jun 16 12:24:10 2015 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/procedure/ZKProcedureCoordinatorRpcs.java      | 5 ++++-
 .../apache/hadoop/hbase/procedure/ZKProcedureMemberRpcs.java    | 5 ++++-
 .../java/org/apache/hadoop/hbase/procedure/ZKProcedureUtil.java | 5 +++++
 3 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/d7b56f63/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ZKProcedureCoordinatorRpcs.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ZKProcedureCoordinatorRpcs.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ZKProcedureCoordinatorRpcs.java
index 1a85101..02af4a8 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ZKProcedureCoordinatorRpcs.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ZKProcedureCoordinatorRpcs.java
@@ -275,7 +275,10 @@ public class ZKProcedureCoordinatorRpcs implements ProcedureCoordinatorRpcs
{
     ForeignException ee = null;
     try {
       byte[] data = ZKUtil.getData(zkProc.getWatcher(), abortNode);
-      if (!ProtobufUtil.isPBMagicPrefix(data)) {
+      if (data == null || data.length == 0) {
+        // ignore
+        return;
+      } else if (!ProtobufUtil.isPBMagicPrefix(data)) {
         LOG.warn("Got an error notification for op:" + abortNode
             + " but we can't read the information. Killing the procedure.");
         // we got a remote exception, but we can't describe it

http://git-wip-us.apache.org/repos/asf/hbase/blob/d7b56f63/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ZKProcedureMemberRpcs.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ZKProcedureMemberRpcs.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ZKProcedureMemberRpcs.java
index 6ac2a47..2e03a60 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ZKProcedureMemberRpcs.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ZKProcedureMemberRpcs.java
@@ -318,7 +318,10 @@ public class ZKProcedureMemberRpcs implements ProcedureMemberRpcs {
       // figure out the data we need to pass
       ForeignException ee;
       try {
-        if (!ProtobufUtil.isPBMagicPrefix(data)) {
+        if (data == null || data.length == 0) {
+          // ignore
+          return;
+        } else if (!ProtobufUtil.isPBMagicPrefix(data)) {
           String msg = "Illegally formatted data in abort node for proc " + opName
               + ".  Killing the procedure.";
           LOG.error(msg);

http://git-wip-us.apache.org/repos/asf/hbase/blob/d7b56f63/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ZKProcedureUtil.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ZKProcedureUtil.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ZKProcedureUtil.java
index 342ab22..9e0ef7f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ZKProcedureUtil.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ZKProcedureUtil.java
@@ -283,6 +283,11 @@ public abstract class ZKProcedureUtil
     // TODO This is potentially racy since not atomic. update when we support zk that has
multi
     LOG.info("Clearing all znodes for procedure " + procedureName + "including nodes "
         + acquiredZnode + " " + reachedZnode + " " + abortZnode);
+
+    // Make sure we trigger the watches on these nodes by creating them. (HBASE-13885)
+    ZKUtil.createAndFailSilent(watcher, getAcquiredBarrierNode(procedureName));
+    ZKUtil.createAndFailSilent(watcher, getAbortZNode(procedureName));
+
     ZKUtil.deleteNodeRecursively(watcher, getAcquiredBarrierNode(procedureName));
     ZKUtil.deleteNodeRecursively(watcher, getReachedBarrierNode(procedureName));
     ZKUtil.deleteNodeRecursively(watcher, getAbortZNode(procedureName));


Mime
View raw message