Return-Path: Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: (qmail 91386 invoked from network); 13 Dec 2010 22:48:27 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Dec 2010 22:48:27 -0000 Received: (qmail 86804 invoked by uid 500); 13 Dec 2010 22:48:27 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 86751 invoked by uid 500); 13 Dec 2010 22:48:26 -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 86743 invoked by uid 99); 13 Dec 2010 22:48:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Dec 2010 22:48:26 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Dec 2010 22:48:24 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oBDMm2Xm006087 for ; Mon, 13 Dec 2010 22:48:02 GMT Message-ID: <13165352.101231292280482457.JavaMail.jira@thor> Date: Mon, 13 Dec 2010 17:48:02 -0500 (EST) From: "Hairong Kuang (JIRA)" To: hdfs-issues@hadoop.apache.org Subject: [jira] Commented: (HDFS-1526) Dfs client name for a map/reduce task should have some randomness In-Reply-To: <32242487.89841291360451422.JavaMail.jira@thor> 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-1526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971062#action_12971062 ] Hairong Kuang commented on HDFS-1526: ------------------------------------- Which constant string we should choose? null seems not user friendly. How about an empty string or "NONMAPREDUCE"? > Dfs client name for a map/reduce task should have some randomness > ----------------------------------------------------------------- > > Key: HDFS-1526 > URL: https://issues.apache.org/jira/browse/HDFS-1526 > Project: Hadoop HDFS > Issue Type: Bug > Components: hdfs client > Reporter: Hairong Kuang > Assignee: Hairong Kuang > Fix For: 0.23.0 > > Attachments: clientName.patch, randClientId1.patch, randClientId2.patch > > > Fsck shows one of the files in our dfs cluster is corrupt. > /bin/hadoop fsck aFile -files -blocks -locations > aFile: 4633 bytes, 2 block(s): > aFile: CORRUPT block blk_-4597378336099313975 > OK > 0. blk_-4597378336099313975_2284630101 len=0 repl=3 [...] > 1. blk_5024052590403223424_2284630107 len=4633 repl=3 [...]Status: CORRUPT > On disk, these two blocks are of the same size and the same content. It turns out the writer of the file is from a multiple threaded map task. Each thread may write to the same file. One possible interaction of two threads might make this to happen: > [T1: create aFile] [T2: delete aFile] [T2: create aFile][T1: addBlock 0 to aFile][T2: addBlock1 to aFile]... > Because T1 and T2 have the same client name, which is the map task id, the above interactions could be done without any lease exception, thus eventually leading to a corrupt file. To solve the problem, a mapreduce task's client name could be formed by its task id followed by a random number. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.