HBASE-24546 CloneSnapshotProcedure unlimited retry (#1900)

Signed-off-by: Guanghao Zhang <zghao@apache.org>
This commit is contained in:
WenFeiYi 2020-07-06 13:45:19 +08:00 committed by Guanghao Zhang
parent 0e74a8c86b
commit 5416cef27f
1 changed files with 5 additions and 0 deletions

View File

@ -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);