HDFS-6245. Datanode fails to start with a bad disk even when failed volumes is set. (Arpit Agarwal)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1588842 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Arpit Agarwal 2014-04-21 00:15:16 +00:00
parent 4810e2b849
commit 2d9f038e63
3 changed files with 14 additions and 3 deletions

View File

@ -417,6 +417,9 @@ Release 2.4.1 - UNRELEASED
HDFS-6236. ImageServlet should use Time#monotonicNow to measure latency.
(cnauroth)
HDFS-6245. datanode fails to start with a bad disk even when failed
volumes is set. (Arpit Agarwal)
Release 2.4.0 - 2014-04-07
INCOMPATIBLE CHANGES

View File

@ -1776,8 +1776,15 @@ public class DataNode extends Configured
try {
location = StorageLocation.parse(locationString);
} catch (IOException ioe) {
throw new IllegalArgumentException("Failed to parse conf property "
+ DFS_DATANODE_DATA_DIR_KEY + ": " + locationString, ioe);
LOG.error("Failed to initialize storage directory " + locationString
+ ". Exception details: " + ioe);
// Ignore the exception.
continue;
} catch (SecurityException se) {
LOG.error("Failed to initialize storage directory " + locationString
+ ". Exception details: " + se);
// Ignore the exception.
continue;
}
locations.add(location);

View File

@ -78,7 +78,8 @@ public class StorageLocation {
* @return A StorageLocation object if successfully parsed, null otherwise.
* Does not throw any exceptions.
*/
static StorageLocation parse(String rawLocation) throws IOException {
static StorageLocation parse(String rawLocation)
throws IOException, SecurityException {
Matcher matcher = regex.matcher(rawLocation);
StorageType storageType = StorageType.DEFAULT;
String location = rawLocation;