HBASE-26030 hbase-cleanup.sh did not clean the wal dir if hbase.wal.dir configured individually (#3432)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
mokai 2021-07-03 11:13:50 +08:00 committed by GitHub
parent 7aa0dfa4a8
commit b80d70cd53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -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 "deleteall ${zparent}";
execute_hdfs_command "-rm -R ${hrootdir}"
if [ "${hbasewaldir}" != "null" ]; then
execute_hdfs_command "-rm -R ${hbasewaldir}"
fi
;;
--cleanAcls)
execute_clean_acls;