hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject [1/4] hbase git commit: HBASE-13885 ZK watches leaks during snapshots.
Date Tue, 16 Jun 2015 19:25:02 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 f2f19ddb5 -> 7f6f199cf
  refs/heads/branch-1.1 5d26dec53 -> d7b56f631
  refs/heads/branch-1.2 55a7a496f -> cb126dd99
  refs/heads/master a10a82a8f -> ce2fd2c58


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/ce2fd2c5
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/ce2fd2c5
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/ce2fd2c5

Branch: refs/heads/master
Commit: ce2fd2c58c5358f07defe13c8ae56e1bbfd59590
Parents: a10a82a
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:21:49 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/ce2fd2c5/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 3e32ca2..fedd595 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/ce2fd2c5/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/ce2fd2c5/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