Return-Path: Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: (qmail 79775 invoked from network); 24 Jun 2010 22:19:16 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 24 Jun 2010 22:19:16 -0000 Received: (qmail 57694 invoked by uid 500); 24 Jun 2010 22:19:16 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 57607 invoked by uid 500); 24 Jun 2010 22:19:16 -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 57546 invoked by uid 99); 24 Jun 2010 22:19:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Jun 2010 22:19:15 +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; Thu, 24 Jun 2010 22:19:13 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o5OMIpbV020475 for ; Thu, 24 Jun 2010 22:18:51 GMT Message-ID: <577832.48401277417931379.JavaMail.jira@thor> Date: Thu, 24 Jun 2010 18:18:51 -0400 (EDT) From: "Todd Lipcon (JIRA)" To: hdfs-issues@hadoop.apache.org Subject: [jira] Commented: (HDFS-1186) 0.20: DNs should interrupt writers at start of recovery In-Reply-To: <8074260.166471275595439491.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-1186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12882365#action_12882365 ] Todd Lipcon commented on HDFS-1186: ----------------------------------- Hi Sam, thanks for taking a look. I think you're right that in some really weird timing scenarios we might have a problem: {noformat} writer writes offset 1 and syncs, gs=1 NN recovery starts: - interrupts writer, gets metadata (len 1) - recovering DN hangs for a little bit writer recovery starts, picks a different primary DN: - interrupts writer (noop) - gets metadata (len 1) - gets new GS=2 - syncs blocks to GS=2 len=1 - restarts pipeline - writes and syncs some more data to block with GS=2 NN-directed recovery proceeds: - gets new GS=3 (this has to be at least 10 seconds after above due to lastRecoveryTime check) - calls updateBlock on all DNs, which truncates files {noformat} I think the issue here is that the genstamp can be incremented in between startBlockRecovery() and updateBlock(), and thus updateBlock is allowing an update based on stale recovery info. If we simply added a check in tryUpdateBlock() that oldblock.getGenerationStamp() == oldgs, I think we'd be safe. What do you think? > 0.20: DNs should interrupt writers at start of recovery > ------------------------------------------------------- > > Key: HDFS-1186 > URL: https://issues.apache.org/jira/browse/HDFS-1186 > Project: Hadoop HDFS > Issue Type: Bug > Components: data-node > Affects Versions: 0.20-append > Reporter: Todd Lipcon > Assignee: Todd Lipcon > Priority: Blocker > Attachments: hdfs-1186.txt > > > When block recovery starts (eg due to NN recovering lease) it needs to interrupt any writers currently writing to those blocks. Otherwise, an old writer (who hasn't realized he lost his lease) can continue to write+sync to the blocks, and thus recovery ends up truncating data that has been sync()ed. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.