You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by vi...@apache.org on 2015/09/02 03:29:23 UTC
hadoop git commit: HDFS-7884. Fix NullPointerException in BlockSender
when the generation stamp provided by the client is larger than the one
stored in the datanode. Contributed by Brahma Reddy Battula
Repository: hadoop
Updated Branches:
refs/heads/branch-2.6.1 914cc8f4a -> 9b105b78d
HDFS-7884. Fix NullPointerException in BlockSender when the generation stamp provided by the client is larger than the one stored in the datanode. Contributed by Brahma Reddy Battula
(cherry picked from commit fe693b72dec703ecbf4ab3919d61d06ea8735a9e)
(cherry picked from commit 4c648779d69a668f5147b183af2d40d45d1227d2)
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/9b105b78
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/9b105b78
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/9b105b78
Branch: refs/heads/branch-2.6.1
Commit: 9b105b78d403b18111959ff2d59b32a78744179b
Parents: 914cc8f
Author: Tsz-Wo Nicholas Sze <sz...@hortonworks.com>
Authored: Tue Mar 24 13:49:17 2015 +0900
Committer: Vinod Kumar Vavilapalli <vi...@apache.org>
Committed: Tue Sep 1 18:25:02 2015 -0700
----------------------------------------------------------------------
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 4 ++++
.../org/apache/hadoop/hdfs/server/datanode/BlockSender.java | 7 +++++++
2 files changed, 11 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/9b105b78/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index 904d02d..5ffe005 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -102,6 +102,10 @@ Release 2.6.1 - UNRELEASED
HDFS-7930. commitBlockSynchronization() does not remove locations. (yliu)
+ HDFS-7884. Fix NullPointerException in BlockSender when the generation stamp
+ provided by the client is larger than the one stored in the datanode.
+ (Brahma Reddy Battula via szetszwo)
+
Release 2.6.0 - 2014-11-18
INCOMPATIBLE CHANGES
http://git-wip-us.apache.org/repos/asf/hadoop/blob/9b105b78/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java
index c8855d7..fdfdbfa 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java
@@ -240,6 +240,13 @@ class BlockSender implements java.io.Closeable {
if (replica.getGenerationStamp() < block.getGenerationStamp()) {
throw new IOException("Replica gen stamp < block genstamp, block="
+ block + ", replica=" + replica);
+ } else if (replica.getGenerationStamp() > block.getGenerationStamp()) {
+ if (DataNode.LOG.isDebugEnabled()) {
+ DataNode.LOG.debug("Bumping up the client provided"
+ + " block's genstamp to latest " + replica.getGenerationStamp()
+ + " for block " + block);
+ }
+ block.setGenerationStamp(replica.getGenerationStamp());
}
if (replicaVisibleLength < 0) {
throw new IOException("Replica is not readable, block="