Return-Path: Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: (qmail 28026 invoked from network); 28 Feb 2011 18:03:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Feb 2011 18:03:00 -0000 Received: (qmail 89567 invoked by uid 500); 28 Feb 2011 18:02:59 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 89450 invoked by uid 500); 28 Feb 2011 18:02:58 -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 89442 invoked by uid 99); 28 Feb 2011 18:02:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Feb 2011 18:02:57 +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; Mon, 28 Feb 2011 18:02:57 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id DF51D41238 for ; Mon, 28 Feb 2011 18:02:36 +0000 (UTC) Date: Mon, 28 Feb 2011 18:02:36 +0000 (UTC) From: "Matt Foley (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: <775676746.2274.1298916156911.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <996490139.849.1298876617099.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Commented: (HDFS-1667) Consider redesign of block report processing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-1667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13000437#comment-13000437 ] Matt Foley commented on HDFS-1667: ---------------------------------- Hi Brian, I agree that's a real risk. The hybrid solution I had in mind was: (a) Send a full block report at startup. (b) Send a checksum of a full report with every differential report -- the namenode can then scan its own blocklist for that datanode, and see if the checksum is what's expected. If not, it can demand a full block report from the datanode. (c) Send a full block report periodically, even if not asked (as you suggest). With the checksum in every diff report, I was thinking it would be adequate to send the full report daily, but of course that can be parameterized. > Consider redesign of block report processing > -------------------------------------------- > > Key: HDFS-1667 > URL: https://issues.apache.org/jira/browse/HDFS-1667 > Project: Hadoop HDFS > Issue Type: Improvement > Components: name-node > Affects Versions: 0.22.0 > Reporter: Matt Foley > Assignee: Matt Foley > > The current implementation of block reporting has the datanode send the entire list of blocks resident on that node in every report, hourly. BlockManager.processReport in the namenode runs each block report through reportDiff() first, to build four linked lists of replicas for different dispositions, then processes each list. During that process, every block belonging to the node (even the unchanged blocks) are removed and re-linked in that node's blocklist. The entire process happens under the global FSNamesystem write lock, so there is essentially zero concurrency. It takes about 90 milliseconds to process a single 50,000-replica block report in the namenode, during which no other read or write activities can occur. > There are several opportunities for improvement in this design. In order of probable benefit, they include: > 1. Change the datanode to send a differential report. This saves the namenode from having to do most of the work in reportDiff(), and avoids the need to re-link all the unchanged blocks during the "diff" calculation. > 2. Keep the linked lists of "to do" work, but modify reportDiff() so that it can be done under a read lock instead of the write lock. Then only the processing of the lists needs to be under the write lock. Since the number of blocks changed is usually much smaller than the number unchanged, this should improve concurrency. > 3. Eliminate the linked lists and just immediately process each changed block as it is read from the block report. The work on HDFS-1295 indicates that this might save a large fraction of the total block processing time at scale, due to the much smaller number of objects created and garbage collected during processing of hundreds of millions of blocks. > 4. As a sidelight to #3, remove linked list use from BlockManager.addBlock(). It currently uses linked lists as an argument to processReportedBlock() even though addBlock() only processes a single replica on each call. This should be replaced with a call to immediately process the block instead of enqueuing it. -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira