Return-Path: Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: (qmail 49627 invoked from network); 4 Mar 2011 04:06:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Mar 2011 04:06:39 -0000 Received: (qmail 99444 invoked by uid 500); 4 Mar 2011 04:06:38 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 99413 invoked by uid 500); 4 Mar 2011 04:06:38 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 99404 invoked by uid 99); 4 Mar 2011 04:06:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2011 04:06:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2011 04:06:35 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C0ED12388A36; Fri, 4 Mar 2011 04:06:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1077351 - in /hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs: DFSClient.java server/datanode/BlockReceiver.java Date: Fri, 04 Mar 2011 04:06:14 -0000 To: common-commits@hadoop.apache.org From: omalley@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110304040614.C0ED12388A36@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: omalley Date: Fri Mar 4 04:06:14 2011 New Revision: 1077351 URL: http://svn.apache.org/viewvc?rev=1077351&view=rev Log: commit fb88642e8acee8dacb5c8146b3b70344f6021a84 Author: Hairong Kuang Date: Sun Mar 21 01:55:11 2010 +0000 HDFS:101 from https://issues.apache.org/jira/secure/attachment/12439387/pipelineHeartbeat_yahoo.patch Modified: hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java Modified: hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java?rev=1077351&r1=1077350&r2=1077351&view=diff ============================================================================== --- hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java (original) +++ hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java Fri Mar 4 04:06:14 2011 @@ -2553,7 +2553,7 @@ public class DFSClient implements FSCons // read an ack from the pipeline ack.readFields(blockReplyStream); if (LOG.isDebugEnabled()) { - LOG.debug("DFSClient " + ack); + LOG.debug("DFSClient for block " + block + " " + ack); } long seqno = ack.getSeqno(); if (seqno == PipelineAck.HEART_BEAT.getSeqno()) { @@ -2567,7 +2567,7 @@ public class DFSClient implements FSCons } if (one.seqno != seqno) { throw new IOException("Responseprocessor: Expecting seqno " + - " for block " + block + + " for block " + block + " " + one.seqno + " but received " + seqno); } lastPacketInBlock = one.lastPacketInBlock; Modified: hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java?rev=1077351&r1=1077350&r2=1077351&view=diff ============================================================================== --- hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java (original) +++ hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java Fri Mar 4 04:06:14 2011 @@ -873,18 +873,16 @@ class BlockReceiver implements java.io.C PipelineAck ack = new PipelineAck(); long seqno = -2; try { - if (!mirrorError) { + if (!mirrorError) { // read an ack from downstream datanode - ack.readFields(mirrorIn); - if (LOG.isDebugEnabled()) { - LOG.debug("PacketResponder " + numTargets + " got " + ack); - } - seqno = ack.getSeqno(); - } - if (seqno == PipelineAck.HEART_BEAT.getSeqno()) { - ack.write(replyOut); // send keepalive - replyOut.flush(); - } else if (seqno >= 0 || mirrorError) { + ack.readFields(mirrorIn); + if (LOG.isDebugEnabled()) { + LOG.debug("PacketResponder " + numTargets + + " for block " + block + " got " + ack); + } + seqno = ack.getSeqno(); + } + if (seqno >= 0 || mirrorError) { Packet pkt = null; synchronized (this) { while (running && datanode.shouldRun && ackQueue.size() == 0) { @@ -963,20 +961,25 @@ class BlockReceiver implements java.io.C } } - // construct my ack message - short[] replies = null; - if (mirrorError) { // no ack is read - replies = new short[2]; - replies[0] = DataTransferProtocol.OP_STATUS_SUCCESS; - replies[1] = DataTransferProtocol.OP_STATUS_ERROR; + PipelineAck replyAck; + if (seqno == PipelineAck.HEART_BEAT.getSeqno()) { + replyAck = ack; // continue to send keep alive } else { - replies = new short[1+ack.getNumOfReplies()]; - replies[0] = DataTransferProtocol.OP_STATUS_SUCCESS; - for (int i=0; i