You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zg...@apache.org on 2020/07/06 06:07:00 UTC

[hbase] branch branch-2 updated: HBASE-24546 CloneSnapshotProcedure unlimited retry (#1900)

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

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


The following commit(s) were added to refs/heads/branch-2 by this push:
     new 5416cef  HBASE-24546 CloneSnapshotProcedure unlimited retry (#1900)
5416cef is described below

commit 5416cef27fc2740e1b5920f9b51dbb5986e6bbc9
Author: WenFeiYi <we...@gmail.com>
AuthorDate: Mon Jul 6 13:45:19 2020 +0800

    HBASE-24546 CloneSnapshotProcedure unlimited retry (#1900)
    
    Signed-off-by: Guanghao Zhang <zg...@apache.org>
---
 .../apache/hadoop/hbase/master/procedure/CloneSnapshotProcedure.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CloneSnapshotProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CloneSnapshotProcedure.java
index 99bb26e..1c2bddc 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CloneSnapshotProcedure.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CloneSnapshotProcedure.java
@@ -458,6 +458,11 @@ public class CloneSnapshotProcedure
     // 1. Create Table Descriptor
     // using a copy of descriptor, table will be created enabling first
     final Path tempTableDir = CommonFSUtils.getTableDir(tempdir, tableDescriptor.getTableName());
+    if (CommonFSUtils.isExists(mfs.getFileSystem(), tempTableDir)) {
+      // if the region dirs exist, will cause exception and unlimited retry (see HBASE-24546)
+      LOG.warn("temp table dir already exists on disk: {}, will be deleted.", tempTableDir);
+      CommonFSUtils.deleteDirectory(mfs.getFileSystem(), tempTableDir);
+    }
     ((FSTableDescriptors) (env.getMasterServices().getTableDescriptors()))
       .createTableDescriptorForTableDirectory(tempTableDir,
         TableDescriptorBuilder.newBuilder(tableDescriptor).build(), false);