Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B47376A4E for ; Thu, 30 Jun 2011 16:25:52 +0000 (UTC) Received: (qmail 35619 invoked by uid 500); 30 Jun 2011 16:25:52 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 35473 invoked by uid 500); 30 Jun 2011 16:25:52 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 35457 invoked by uid 99); 30 Jun 2011 16:25:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Jun 2011 16:25:51 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Jun 2011 16:25:49 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 9994A43CBBF for ; Thu, 30 Jun 2011 16:25:28 +0000 (UTC) Date: Thu, 30 Jun 2011 16:25:28 +0000 (UTC) From: "Daryn Sharp (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: <589853117.5970.1309451128625.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1321652620.68068.1307162687352.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HDFS-2034) length in getBlockRange becomes -ve when reading only from currently being written blk MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HDFS-2034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13057915#comment-13057915 ] Daryn Sharp commented on HDFS-2034: ----------------------------------- I noticed that the last conditional of {{if (readLengthPastCompleteBlk && offset < getFileLength())}} dropped the RHS side. Presumably this is because it's the condition in the early assert? Todd mentioned earlier that most people run with asserts disabled, which means the method will return the wrong data if asserts are off and the constraint is violated. I'd lean towards the assert being an exception (not sure why we didn't discuss that option earlier), but I'd be happy if the RHS condition was re-added. Todd can be the judge. > length in getBlockRange becomes -ve when reading only from currently being written blk > -------------------------------------------------------------------------------------- > > Key: HDFS-2034 > URL: https://issues.apache.org/jira/browse/HDFS-2034 > Project: Hadoop HDFS > Issue Type: Bug > Reporter: John George > Assignee: John George > Priority: Minor > Attachments: HDFS-2034-1.patch, HDFS-2034-1.patch, HDFS-2034-2.patch, HDFS-2034-3.patch, HDFS-2034-4.patch, HDFS-2034.patch > > > This came up during HDFS-1907. Posting an example that Todd posted in HDFS-1907 that brought out this issue. > {quote} > Here's an example sequence to describe what I mean: > 1. open file, write one and a half blocks > 2. call hflush > 3. another reader asks for the first byte of the second block > {quote} > In this case since offset is greater than the completed block length, the math in getBlockRange() of DFSInputStreamer.java will set "length" to negative. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira