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 2021/07/03 03:22:18 UTC

[hbase] branch branch-2.3 updated: HBASE-26030 hbase-cleanup.sh did not clean the wal dir if hbase.wal.dir configured individually (#3432)

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

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


The following commit(s) were added to refs/heads/branch-2.3 by this push:
     new 1938aca  HBASE-26030 hbase-cleanup.sh did not clean the wal dir if hbase.wal.dir configured individually (#3432)
1938aca is described below

commit 1938aca5bb359df6702732162a9d11a5dfc43393
Author: mokai <mo...@126.com>
AuthorDate: Sat Jul 3 11:13:50 2021 +0800

    HBASE-26030 hbase-cleanup.sh did not clean the wal dir if hbase.wal.dir configured individually (#3432)
    
    Signed-off-by: Duo Zhang <zh...@apache.org>
---
 bin/hbase-cleanup.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/bin/hbase-cleanup.sh b/bin/hbase-cleanup.sh
index 3a764df..40cee4e 100755
--- a/bin/hbase-cleanup.sh
+++ b/bin/hbase-cleanup.sh
@@ -57,6 +57,8 @@ if [ "$zparent" == "null" ]; then zparent="/hbase"; fi
 hrootdir=`$bin/hbase org.apache.hadoop.hbase.util.HBaseConfTool hbase.rootdir`
 if [ "$hrootdir" == "null" ]; then hrootdir="file:///tmp/hbase-${USER}/hbase"; fi
 
+hbasewaldir=`$bin/hbase org.apache.hadoop.hbase.util.HBaseConfTool hbase.wal.dir`
+
 check_for_znodes() {
   command=$1;
   case $command in
@@ -102,10 +104,16 @@ clean_up() {
     ;;
   --cleanHdfs)
     execute_hdfs_command "-rm -R ${hrootdir}"
+    if [ "${hbasewaldir}" != "null" ]; then
+      execute_hdfs_command "-rm -R ${hbasewaldir}"
+    fi
     ;;
   --cleanAll)
     execute_zk_command "rmr ${zparent}";
     execute_hdfs_command "-rm -R ${hrootdir}"
+    if [ "${hbasewaldir}" != "null" ]; then
+      execute_hdfs_command "-rm -R ${hbasewaldir}"
+    fi
     ;;
   --cleanAcls)
     execute_clean_acls;