HDFS-8930. Block report lease may leak if the 2nd full block report comes when NN is still in safemode (Colin P. McCabe via Jing Zhao)

This commit is contained in:
Colin Patrick Mccabe 2015-08-24 11:31:56 -07:00
parent feaf034994
commit b5ce87f84d
3 changed files with 4 additions and 2 deletions

View File

@ -1201,6 +1201,9 @@ Release 2.8.0 - UNRELEASED
HDFS-8942. Update hyperlink to rack awareness page in HDFS Architecture
documentation. (Masatake Iwasaki via aajisaka)
HDFS-8930. Block report lease may leak if the 2nd full block report comes
when NN is still in safemode (Colin P. McCabe via Jing Zhao)
Release 2.7.2 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -1849,6 +1849,7 @@ public class BlockManager implements BlockStatsMXBean {
blockLog.info("BLOCK* processReport: "
+ "discarded non-initial block report from {}"
+ " because namenode still in startup phase", nodeID);
blockReportLeaseManager.removeLease(node);
return !node.hasStaleStorages();
}
if (context != null) {

View File

@ -29,7 +29,6 @@ import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hdfs.MiniDFSCluster;
import org.apache.hadoop.hdfs.protocol.DatanodeID;
import org.apache.hadoop.hdfs.server.datanode.DataNode;
import org.apache.hadoop.hdfs.server.protocol.BlockReportContext;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
@ -40,7 +39,6 @@ import org.junit.Test;
import java.io.IOException;
import java.util.HashSet;
import java.util.List;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;