diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 53c9c0abc8..014bfdaaee 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 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 51b1006a7f..e574d1d080 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 @@ private synchronized void releaseBuffer(ByteArrayManager bam) { 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