Skip to content

Commit 5416cef

Browse files
WenFeiYiinfraio
authored andcommitted
HBASE-24546 CloneSnapshotProcedure unlimited retry (#1900)
Signed-off-by: Guanghao Zhang <zghao@apache.org>
1 parent 0e74a8c commit 5416cef

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CloneSnapshotProcedure.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,11 @@ private List<RegionInfo> createFsLayout(
458458
// 1. Create Table Descriptor
459459
// using a copy of descriptor, table will be created enabling first
460460
final Path tempTableDir = CommonFSUtils.getTableDir(tempdir, tableDescriptor.getTableName());
461+
if (CommonFSUtils.isExists(mfs.getFileSystem(), tempTableDir)) {
462+
// if the region dirs exist, will cause exception and unlimited retry (see HBASE-24546)
463+
LOG.warn("temp table dir already exists on disk: {}, will be deleted.", tempTableDir);
464+
CommonFSUtils.deleteDirectory(mfs.getFileSystem(), tempTableDir);
465+
}
461466
((FSTableDescriptors) (env.getMasterServices().getTableDescriptors()))
462467
.createTableDescriptorForTableDirectory(tempTableDir,
463468
TableDescriptorBuilder.newBuilder(tableDescriptor).build(), false);

0 commit comments

Comments
 (0)