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 05:40:14 UTC

[hbase] branch branch-2.2 updated: HBASE-24546 CloneSnapshotProcedure unlimited retry (#1916)

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

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


The following commit(s) were added to refs/heads/branch-2.2 by this push:
     new 1c84b53  HBASE-24546 CloneSnapshotProcedure unlimited retry (#1916)
1c84b53 is described below

commit 1c84b535b6cf29f7e4aee35e4b51c3cfa23c0375
Author: WenFeiYi <we...@gmail.com>
AuthorDate: Mon Jul 6 13:39:59 2020 +0800

    HBASE-24546 CloneSnapshotProcedure unlimited retry (#1916)
    
    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 c569de2..9d64074 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
@@ -457,6 +457,11 @@ public class CloneSnapshotProcedure
     // 1. Create Table Descriptor
     // using a copy of descriptor, table will be created enabling first
     final Path tempTableDir = FSUtils.getTableDir(tempdir, tableDescriptor.getTableName());
+    if (FSUtils.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);
+      FSUtils.deleteDirectory(mfs.getFileSystem(), tempTableDir);
+    }
     ((FSTableDescriptors)(env.getMasterServices().getTableDescriptors()))
       .createTableDescriptorForTableDirectory(tempTableDir,
               TableDescriptorBuilder.newBuilder(tableDescriptor).build(), false);