[
https://issues.apache.org/jira/browse/HDFS-16985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17717433#comment-17717433
]
ASF GitHub Bot commented on HDFS-16985:
---------------------------------------
smarthanwang commented on code in PR #5564:
URL: https://github.com/apache/hadoop/pull/5564#discussion_r1179874552
##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestFsDatasetImpl.java:
##########
@@ -1919,4 +1919,63 @@ public void delayDeleteReplica() {
DataNodeFaultInjector.set(oldInjector);
}
}
+
+ /**
+ * Test the block file which is not found when disk with some exception.
+ * We expect:
+ * 1. block file wouldn't be deleted from disk.
+ * 2. block info would be removed from dn memory.
+ * 3. block would be reported to nn as missing block.
+ * 4. block would be recovered when disk back to normal.
+ */
+ @Test
+ public void tesInvalidateMissingBlock() throws Exception {
+ long blockSize = 1024;
+ int heatbeatInterval = 1;
+ HdfsConfiguration c = new HdfsConfiguration();
+ c.setInt(DFSConfigKeys.DFS_HEARTBEAT_INTERVAL_KEY, heatbeatInterval);
Review Comment:
These have no more purpose, just some init codes copy.
> delete local block file when FileNotFoundException occurred may lead to
> missing block.
> --------------------------------------------------------------------------------------
>
> Key: HDFS-16985
> URL: https://issues.apache.org/jira/browse/HDFS-16985
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: datanode
> Reporter: Chengwei Wang
> Assignee: Chengwei Wang
> Priority: Major
> Labels: pull-request-available
>
> We encounterd several missing-block problem in our production cluster which
> hdfs running on AWS EC2 + EBS.
> The root cause:
> # the block remains only 1 replication left and hasn't been reconstruction
> # DN checks block file existing when BlockSender construction
> # the EBS checking failed and throw FileNotFoundException (EBS may be in
> fault condition)
> # DN invalidateBlock and schedule block async deletion
> # EBS already back to normal when DN do delete block
> # the block file be delete permanently and can't be recovered
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]