Skip to content

Commit 0855937

Browse files
committed
HBASE-29572 Clean up output directory when copying the manifest fails during snapshot export
1 parent e203a59 commit 0855937

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,9 @@ public int doWork() throws IOException {
10661066
conf.getInt(CONF_COPY_MANIFEST_THREADS, DEFAULT_COPY_MANIFEST_THREADS));
10671067
copySucceeded = true;
10681068
} catch (IOException e) {
1069+
if (outputFs.exists(initialOutputSnapshotDir)) {
1070+
outputFs.delete(initialOutputSnapshotDir, true);
1071+
}
10691072
throw new ExportSnapshotException("Failed to copy the snapshot directory: from=" + snapshotDir
10701073
+ " to=" + initialOutputSnapshotDir, e);
10711074
} finally {

0 commit comments

Comments
 (0)