Jelajahi Sumber

HDFS-1346. DFSClient receives out of order packet ack. Contributed by Hairong Kuang.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-append@1001848 13f79535-47bb-0310-9956-ffa450edef68
Hairong Kuang 14 tahun lalu
induk
melakukan
c67c398f81

+ 2 - 0
CHANGES.txt

@@ -80,6 +80,8 @@ Release 0.20-append - Unreleased
     HDFS-1254. Support append/sync via the default configuration.
     (dhruba)
 
+    HDFS-1346. DFSClient receives out of order packet ack. (hairong)
+
 Release 0.20.3 - Unreleased
 
   NEW FEATURES

+ 4 - 3
src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java

@@ -882,8 +882,9 @@ class BlockReceiver implements java.io.Closeable, FSConstants {
             long seqno = -2;
 
             PipelineAck ack = new PipelineAck();
+            boolean localMirrorError = mirrorError;
             try { 
-              if (!mirrorError) {
+              if (!localMirrorError) {
                 // read an ack from downstream datanode
                 ack.readFields(mirrorIn, numTargets);
                 if (LOG.isDebugEnabled()) {
@@ -892,7 +893,7 @@ class BlockReceiver implements java.io.Closeable, FSConstants {
                 }
                 seqno = ack.getSeqno();
               }
-              if (seqno >= 0 || mirrorError) {
+              if (seqno >= 0 || localMirrorError) {
                 Packet pkt = null;
                 synchronized (this) {
                   while (running && datanode.shouldRun && ackQueue.size() == 0) {
@@ -910,7 +911,7 @@ class BlockReceiver implements java.io.Closeable, FSConstants {
                   pkt = ackQueue.removeFirst();
                   expected = pkt.seqno;
                   notifyAll();
-                  if (seqno != expected && !mirrorError) {
+                  if (seqno != expected && !localMirrorError) {
                     throw new IOException("PacketResponder " + numTargets +
                                           " for block " + block +
                                           " expected seqno:" + expected +