HBASE-9329 SnapshotManager should check for directory existance before throwing a warning (Jean-Marc Spaggiari)
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1517608 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f3fbf8c5d2
commit
5700f61b95
|
@ -57,7 +57,6 @@ import org.apache.hadoop.hbase.procedure.Procedure;
|
|||
import org.apache.hadoop.hbase.procedure.ProcedureCoordinator;
|
||||
import org.apache.hadoop.hbase.procedure.ProcedureCoordinatorRpcs;
|
||||
import org.apache.hadoop.hbase.procedure.ZKProcedureCoordinatorRpcs;
|
||||
import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
|
||||
import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription;
|
||||
import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription.Type;
|
||||
import org.apache.hadoop.hbase.snapshot.ClientSnapshotDescriptionUtils;
|
||||
|
@ -268,8 +267,10 @@ public class SnapshotManager implements Stoppable {
|
|||
void resetTempDir() throws IOException {
|
||||
// cleanup any existing snapshots.
|
||||
Path tmpdir = SnapshotDescriptionUtils.getWorkingSnapshotDir(rootDir);
|
||||
if (!master.getMasterFileSystem().getFileSystem().delete(tmpdir, true)) {
|
||||
LOG.warn("Couldn't delete working snapshot directory: " + tmpdir);
|
||||
if (master.getMasterFileSystem().getFileSystem().exists(tmpdir)) {
|
||||
if (!master.getMasterFileSystem().getFileSystem().delete(tmpdir, true)) {
|
||||
LOG.warn("Couldn't delete working snapshot directory: " + tmpdir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue