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 2014/11/17 15:49:47 UTC

hadoop git commit: HDFS-7399. Lack of synchronization in DFSOutputStream#Packet#getLastByteOffsetBlock() (Contributed by Vinayakumar B)

Repository: hadoop
Updated Branches:
  refs/heads/trunk 26d3b7e6a -> 6783d17fc


HDFS-7399. Lack of synchronization in DFSOutputStream#Packet#getLastByteOffsetBlock() (Contributed by Vinayakumar B)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/6783d17f
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/6783d17f
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/6783d17f

Branch: refs/heads/trunk
Commit: 6783d17fcf5b25165767888f756a6b7802ab1371
Parents: 26d3b7e
Author: Vinayakumar B <vi...@apache.org>
Authored: Mon Nov 17 20:19:19 2014 +0530
Committer: Vinayakumar B <vi...@apache.org>
Committed: Mon Nov 17 20:19:19 2014 +0530

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt                    | 3 +++
 .../src/main/java/org/apache/hadoop/hdfs/DFSOutputStream.java  | 6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/6783d17f/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 53c9c0a..014bfda 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -433,6 +433,9 @@ Release 2.7.0 - UNRELEASED
     HDFS-7395. BlockIdManager#clear() bails out when resetting the
     GenerationStampV1Limit. (wheat9)
 
+    HDFS-7399. Lack of synchronization in
+    DFSOutputStream#Packet#getLastByteOffsetBlock() (vinayakumarb)
+
 Release 2.6.0 - 2014-11-18
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6783d17f/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSOutputStream.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSOutputStream.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSOutputStream.java
index 51b1006..e574d1d 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSOutputStream.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSOutputStream.java
@@ -342,12 +342,12 @@ public class DFSOutputStream extends FSOutputSummer
       bam.release(buf);
       buf = null;
     }
-    
+
     // get the packet's last byte's offset in the block
-    long getLastByteOffsetBlock() {
+    synchronized long getLastByteOffsetBlock() {
       return offsetInBlock + dataPos - dataStart;
     }
-    
+
     /**
      * Check if this packet is a heart beat packet
      * @return true if the sequence number is HEART_BEAT_SEQNO