Index: src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java (revision 999680) +++ src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java (working copy) @@ -336,10 +336,14 @@ if (fs.exists(dir)) { throw new IOException("Target HLog directory already exists: " + dir); } - fs.mkdirs(dir); + if (!fs.mkdirs(dir)) { + throw new IOException("Unable to mkdir " + dir); + } this.oldLogDir = oldLogDir; if (!fs.exists(oldLogDir)) { - fs.mkdirs(this.oldLogDir); + if (!fs.mkdirs(this.oldLogDir)) { + throw new IOException("Unable to mkdir " + this.oldLogDir); + } } this.maxLogs = conf.getInt("hbase.regionserver.maxlogs", 32); this.enabled = conf.getBoolean("hbase.regionserver.hlog.enabled", true); @@ -699,7 +703,9 @@ LOG.info("moving old hlog file " + FSUtils.getPath(p) + " whose highest sequenceid is " + seqno + " to " + FSUtils.getPath(newPath)); - this.fs.rename(p, newPath); + if (!this.fs.rename(p, newPath)) { + throw new IOException("Unable to rename " + p + " to " + newPath); + } } /** @@ -733,12 +739,16 @@ close(); FileStatus[] files = fs.listStatus(this.dir); for(FileStatus file : files) { - fs.rename(file.getPath(), - getHLogArchivePath(this.oldLogDir, file.getPath())); + Path p = getHLogArchivePath(this.oldLogDir, file.getPath()); + if (!fs.rename(file.getPath(),p)) { + throw new IOException("Unable to rename " + file.getPath() + " to " + p); + } } LOG.debug("Moved " + files.length + " log files to " + FSUtils.getPath(this.oldLogDir)); - fs.delete(dir, true); + if (!fs.delete(dir, true)) { + LOG.info("Unable to delete " + dir); + } } /** @@ -1238,11 +1248,16 @@ Path newPath = getHLogArchivePath(oldLogDir, file.getPath()); LOG.info("Moving " + FSUtils.getPath(file.getPath()) + " to " + FSUtils.getPath(newPath)); - fs.rename(file.getPath(), newPath); + if (!fs.rename(file.getPath(), newPath)) { + throw new IOException("Unable to rename " + file.getPath() + + " to " + newPath); + } } LOG.debug("Moved " + files.length + " log files to " + FSUtils.getPath(oldLogDir)); - fs.delete(srcDir, true); + if (!fs.delete(srcDir, true)) { + throw new IOException("Unable to delete " + srcDir); + } } catch (IOException e) { e = RemoteExceptionHandler.checkIOException(e); IOException io = new IOException("Cannot delete: " + srcDir); @@ -1677,19 +1692,27 @@ final Path corruptDir = new Path(conf.get(HConstants.HBASE_DIR), conf.get("hbase.regionserver.hlog.splitlog.corrupt.dir", ".corrupt")); - fs.mkdirs(corruptDir); + if (!fs.mkdirs(corruptDir)) { + LOG.info("Unable to mkdir " + corruptDir); + } fs.mkdirs(oldLogDir); for (Path corrupted: corruptedLogs) { Path p = new Path(corruptDir, corrupted.getName()); - LOG.info("Moving corrupted log " + corrupted + " to " + p); - fs.rename(corrupted, p); + if (!fs.rename(corrupted, p)) { + LOG.info("Unable to move corrupted log " + corrupted + " to " + p); + } else { + LOG.info("Moving corrupted log " + corrupted + " to " + p); + } } for (Path p: processedLogs) { Path newPath = getHLogArchivePath(oldLogDir, p); - fs.rename(p, newPath); - LOG.info("Archived processed log " + p + " to " + newPath); + if (!fs.rename(p, newPath)) { + LOG.info("Unable to move " + p + " to " + newPath); + } else { + LOG.info("Archived processed log " + p + " to " + newPath); + } } } @@ -1874,4 +1897,4 @@ } } } -} \ No newline at end of file +} Index: src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java (revision 999680) +++ src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java (working copy) @@ -368,7 +368,9 @@ final Path initialFiles, final Path regiondir) throws IOException { if (initialFiles != null && fs.exists(initialFiles)) { - fs.rename(initialFiles, regiondir); + if (!fs.rename(initialFiles, regiondir)) { + LOG.warn("Unable to rename " + initialFiles + " to " + regiondir); + } } } Index: src/main/java/org/apache/hadoop/hbase/regionserver/Store.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/regionserver/Store.java (revision 999680) +++ src/main/java/org/apache/hadoop/hbase/regionserver/Store.java (working copy) @@ -478,7 +478,9 @@ // Write-out finished successfully, move into the right spot Path dstPath = StoreFile.getUniqueFile(fs, homedir); LOG.info("Renaming flushed file at " + writer.getPath() + " to " + dstPath); - fs.rename(writer.getPath(), dstPath); + if (!fs.rename(writer.getPath(), dstPath)) { + LOG.warn("Unable to rename " + writer.getPath() + " to " + dstPath); + } StoreFile sf = new StoreFile(this.fs, dstPath, blockcache, this.conf, this.family.getBloomFilterType(), this.inMemory);