diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/TakeSnapshotHandler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/TakeSnapshotHandler.java index f746adf0b89e..b24f79494045 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/TakeSnapshotHandler.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/TakeSnapshotHandler.java @@ -252,11 +252,11 @@ public void process() { try { // if the working dir is still present, the snapshot has failed. it is present we delete // it. - if (!workingDirFs.delete(workingDir, true)) { - LOG.error("Couldn't delete snapshot working directory:" + workingDir); + if (workingDirFs.exists(workingDir) && !workingDirFs.delete(workingDir, true)) { + LOG.error("Couldn't delete snapshot working directory: {}", workingDir); } } catch (IOException e) { - LOG.error("Couldn't delete snapshot working directory:" + workingDir); + LOG.error("Couldn't get or delete snapshot working directory: {}", workingDir, e); } if (LOG.isDebugEnabled()) { LOG.debug("Table snapshot journal : \n" + status.prettyPrintJournal());