You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2024/05/08 08:01:22 UTC

(hbase) branch branch-2 updated (01317005243 -> bbd23d9d0a2)

This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a change to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git


    from 01317005243 HBASE-28574 Bump jinja2 from 3.1.3 to 3.1.4 in /dev-support/flaky-tests (#5879)
     new 65e4f38a12f HBASE-28575 Always printing error log when snapshot table (#5880)
     new bbd23d9d0a2 HBASE-28563 Closing ZooKeeper in ZKMainServer (#5869)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../hbase/master/snapshot/TakeSnapshotHandler.java |  6 ++---
 .../hadoop/hbase/zookeeper/ZKMainServer.java       | 31 +++++++++++++++++-----
 2 files changed, 27 insertions(+), 10 deletions(-)


(hbase) 01/02: HBASE-28575 Always printing error log when snapshot table (#5880)

Posted by zh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git

commit 65e4f38a12ff4c61a2726d54116ff9dfad129349
Author: guluo <lu...@qq.com>
AuthorDate: Wed May 8 15:31:32 2024 +0800

    HBASE-28575 Always printing error log when snapshot table (#5880)
    
    Signed-off-by: Duo Zhang <zh...@apache.org>
    (cherry picked from commit 2a7aa0d439d8bb17be2cccc057f3d2ec615f7690)
---
 .../apache/hadoop/hbase/master/snapshot/TakeSnapshotHandler.java    | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/TakeSnapshotHandler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/TakeSnapshotHandler.java
index f746adf0b89..b24f7949404 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/TakeSnapshotHandler.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/TakeSnapshotHandler.java
@@ -252,11 +252,11 @@ public abstract class TakeSnapshotHandler extends EventHandler
       try {
         // if the working dir is still present, the snapshot has failed. it is present we delete
         // it.
-        if (!workingDirFs.delete(workingDir, true)) {
-          LOG.error("Couldn't delete snapshot working directory:" + workingDir);
+        if (workingDirFs.exists(workingDir) && !workingDirFs.delete(workingDir, true)) {
+          LOG.error("Couldn't delete snapshot working directory: {}", workingDir);
         }
       } catch (IOException e) {
-        LOG.error("Couldn't delete snapshot working directory:" + workingDir);
+        LOG.error("Couldn't get or delete snapshot working directory: {}", workingDir, e);
       }
       if (LOG.isDebugEnabled()) {
         LOG.debug("Table snapshot journal : \n" + status.prettyPrintJournal());


(hbase) 02/02: HBASE-28563 Closing ZooKeeper in ZKMainServer (#5869)

Posted by zh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git

commit bbd23d9d0a238ff7629d06d637ba2338b253d381
Author: Minwoo Kang <mi...@navercorp.com>
AuthorDate: Wed May 8 16:34:03 2024 +0900

    HBASE-28563 Closing ZooKeeper in ZKMainServer (#5869)
    
    Signed-off-by: Duo Zhang <zh...@apache.org>
    Reviewed-by: Andor Molnár <an...@apache.org>
    (cherry picked from commit 23fa363d360202db73a0d1b517e29841a904026c)
---
 .../hadoop/hbase/zookeeper/ZKMainServer.java       | 31 +++++++++++++++++-----
 1 file changed, 24 insertions(+), 7 deletions(-)

diff --git a/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKMainServer.java b/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKMainServer.java
index 623085b5923..ce849fea1a4 100644
--- a/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKMainServer.java
+++ b/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKMainServer.java
@@ -17,10 +17,12 @@
  */
 package org.apache.hadoop.hbase.zookeeper;
 
+import java.io.Closeable;
 import java.io.IOException;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HBaseInterfaceAudience;
+import org.apache.hadoop.hbase.ZooKeeperConnectionException;
 import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.zookeeper.ZooKeeperMain;
 import org.apache.zookeeper.cli.CliException;
@@ -38,10 +40,11 @@ public class ZKMainServer {
   }
 
   /**
-   * ZooKeeper 3.4.6 broke being able to pass commands on command line. See ZOOKEEPER-1897. This
-   * class is a hack to restore this faclity.
+   * ZooKeeper 3.4.6 broke being able to pass commands on command line. See ZOOKEEPER-1897,
+   * ZOOKEEPER-4804. This class is a hack to restore this faclity.
    */
-  private static class HACK_UNTIL_ZOOKEEPER_1897_ZooKeeperMain extends ZooKeeperMain {
+  private static class HACK_UNTIL_ZOOKEEPER_1897_ZooKeeperMain extends ZooKeeperMain
+    implements Closeable {
     public HACK_UNTIL_ZOOKEEPER_1897_ZooKeeperMain(String[] args)
       throws IOException, InterruptedException {
       super(args);
@@ -49,7 +52,11 @@ public class ZKMainServer {
       // run the command without being connected, we get ConnectionLoss KeeperErrorConnection...
       // Make it 30seconds. We dont' have a config in this context and zk doesn't have
       // a timeout until after connection. 30000ms is default for zk.
-      ZooKeeperHelper.ensureConnectedZooKeeper(this.zk, 30000);
+      try {
+        ZooKeeperHelper.ensureConnectedZooKeeper(this.zk, 30000);
+      } catch (ZooKeeperConnectionException e) {
+        this.zk.close();
+      }
     }
 
     /**
@@ -62,6 +69,15 @@ public class ZKMainServer {
       processCmd(this.cl);
       System.exit(0);
     }
+
+    @Override
+    public void close() throws IOException {
+      try {
+        this.zk.close();
+      } catch (InterruptedException e) {
+        Thread.currentThread().interrupt();
+      }
+    }
   }
 
   /**
@@ -109,9 +125,10 @@ public class ZKMainServer {
     // ZOOKEEPER-1897 was committed to zookeeper-3.4.6 but elsewhere in this class we say
     // 3.4.6 breaks command-processing; TODO.
     if (hasCommandLineArguments(args)) {
-      HACK_UNTIL_ZOOKEEPER_1897_ZooKeeperMain zkm =
-        new HACK_UNTIL_ZOOKEEPER_1897_ZooKeeperMain(newArgs);
-      zkm.runCmdLine();
+      try (HACK_UNTIL_ZOOKEEPER_1897_ZooKeeperMain zkm =
+        new HACK_UNTIL_ZOOKEEPER_1897_ZooKeeperMain(newArgs)) {
+        zkm.runCmdLine();
+      }
     } else {
       ZooKeeperMain.main(newArgs);
     }