Skip to content

Commit 2a7aa0d

Browse files
authored
HBASE-28575 Always printing error log when snapshot table (#5880)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
1 parent f750de2 commit 2a7aa0d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/TakeSnapshotHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,11 @@ public void process() {
252252
try {
253253
// if the working dir is still present, the snapshot has failed. it is present we delete
254254
// it.
255-
if (!workingDirFs.delete(workingDir, true)) {
256-
LOG.error("Couldn't delete snapshot working directory:" + workingDir);
255+
if (workingDirFs.exists(workingDir) && !workingDirFs.delete(workingDir, true)) {
256+
LOG.error("Couldn't delete snapshot working directory: {}", workingDir);
257257
}
258258
} catch (IOException e) {
259-
LOG.error("Couldn't delete snapshot working directory:" + workingDir);
259+
LOG.error("Couldn't get or delete snapshot working directory: {}", workingDir, e);
260260
}
261261
if (LOG.isDebugEnabled()) {
262262
LOG.debug("Table snapshot journal : \n" + status.prettyPrintJournal());

0 commit comments

Comments
 (0)