From bf27b9ca574592ef603e126bacb9b6a37c9eb5c6 Mon Sep 17 00:00:00 2001 From: Kihwal Lee Date: Fri, 19 Sep 2014 09:00:13 -0500 Subject: [PATCH] HDFS-7065. Pipeline close recovery race can cause block corruption. Contributed by Kihwal Lee. --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 2 ++ .../hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 9d76c3768ee..ba1a272cdb7 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -777,6 +777,8 @@ Release 2.6.0 - UNRELEASED HDFS-6840. Clients are always sent to the same datanode when read is off rack. (wang) + HDFS-7065. Pipeline close recovery race can cause block corruption (kihwal) + BREAKDOWN OF HDFS-6134 AND HADOOP-10150 SUBTASKS AND RELATED JIRAS HDFS-6387. HDFS CLI admin tool for creating & deleting an diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java index a2179dc078d..6e8108206d0 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java @@ -904,7 +904,7 @@ class FsDatasetImpl implements FsDatasetSpi { } @Override // FsDatasetSpi - public String recoverClose(ExtendedBlock b, long newGS, + public synchronized String recoverClose(ExtendedBlock b, long newGS, long expectedBlockLen) throws IOException { LOG.info("Recover failed close " + b); // check replica's state