HBASE-12607 TestHBaseFsck#testParallelHbck fails running against hadoop 2.6.0
This commit is contained in:
parent
7310fa2ba7
commit
57b1efaabe
|
@ -129,6 +129,7 @@ import org.apache.hadoop.util.Tool;
|
||||||
import org.apache.hadoop.util.ToolRunner;
|
import org.apache.hadoop.util.ToolRunner;
|
||||||
import org.apache.zookeeper.KeeperException;
|
import org.apache.zookeeper.KeeperException;
|
||||||
|
|
||||||
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
@ -321,7 +322,7 @@ public class HBaseFsck extends Configured {
|
||||||
errors = getErrorReporter(getConf());
|
errors = getErrorReporter(getConf());
|
||||||
this.executor = exec;
|
this.executor = exec;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method maintains a lock using a file. If the creation fails we return null
|
* This method maintains a lock using a file. If the creation fails we return null
|
||||||
*
|
*
|
||||||
|
@ -329,6 +330,7 @@ public class HBaseFsck extends Configured {
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
private FSDataOutputStream checkAndMarkRunningHbck() throws IOException {
|
private FSDataOutputStream checkAndMarkRunningHbck() throws IOException {
|
||||||
|
long start = EnvironmentEdgeManager.currentTime();
|
||||||
try {
|
try {
|
||||||
FileSystem fs = FSUtils.getCurrentFileSystem(getConf());
|
FileSystem fs = FSUtils.getCurrentFileSystem(getConf());
|
||||||
FsPermission defaultPerms = FSUtils.getFilePermissions(fs, getConf(),
|
FsPermission defaultPerms = FSUtils.getFilePermissions(fs, getConf(),
|
||||||
|
@ -346,6 +348,13 @@ public class HBaseFsck extends Configured {
|
||||||
} else {
|
} else {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
long duration = EnvironmentEdgeManager.currentTime() - start;
|
||||||
|
if (duration > 30000) {
|
||||||
|
LOG.warn("Took " + duration + " milliseconds to obtain lock");
|
||||||
|
// took too long to obtain lock
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue