HDFS-9137. DeadLock between DataNode#refreshVolumes and BPOfferService#registrationSucceeded. (Uma Maheswara Rao G via yliu)

This commit is contained in:
yliu 2015-10-08 10:27:47 +08:00
parent 66e2cfa1a0
commit 35affec38e
2 changed files with 22 additions and 6 deletions

View File

@ -1983,6 +1983,9 @@ Release 2.8.0 - UNRELEASED
HDFS-9176. Fix TestDirectoryScanner#testThrottling often fails.
(Daniel Templeton via lei)
HDFS-9137. DeadLock between DataNode#refreshVolumes and
BPOfferService#registrationSucceeded. (Uma Maheswara Rao G via yliu)
Release 2.7.2 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -497,12 +497,29 @@ public class DataNode extends ReconfigurableBase
public void reconfigurePropertyImpl(String property, String newVal)
throws ReconfigurationException {
if (property.equals(DFS_DATANODE_DATA_DIR_KEY)) {
IOException rootException = null;
try {
LOG.info("Reconfiguring " + property + " to " + newVal);
this.refreshVolumes(newVal);
} catch (IOException e) {
throw new ReconfigurationException(property, newVal,
getConf().get(property), e);
rootException = e;
} finally {
// Send a full block report to let NN acknowledge the volume changes.
try {
triggerBlockReport(
new BlockReportOptions.Factory().setIncremental(false).build());
} catch (IOException e) {
LOG.warn("Exception while sending the block report after refreshing"
+ " volumes " + property + " to " + newVal, e);
if (rootException == null) {
rootException = e;
}
} finally {
if (rootException != null) {
throw new ReconfigurationException(property, newVal,
getConf().get(property), rootException);
}
}
}
} else {
throw new ReconfigurationException(
@ -684,10 +701,6 @@ public class DataNode extends ReconfigurableBase
conf.set(DFS_DATANODE_DATA_DIR_KEY,
Joiner.on(",").join(effectiveVolumes));
dataDirs = getStorageLocations(conf);
// Send a full block report to let NN acknowledge the volume changes.
triggerBlockReport(new BlockReportOptions.Factory()
.setIncremental(false).build());
}
}