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 49AD29182 for ; Fri, 7 Oct 2011 14:53:52 +0000 (UTC) Received: (qmail 70337 invoked by uid 500); 7 Oct 2011 14:53:52 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 70278 invoked by uid 500); 7 Oct 2011 14:53: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 70270 invoked by uid 99); 7 Oct 2011 14:53:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Oct 2011 14:53:52 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,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; Fri, 07 Oct 2011 14:53:50 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 15A392AE0E0 for ; Fri, 7 Oct 2011 14:53:30 +0000 (UTC) Date: Fri, 7 Oct 2011 14:53:30 +0000 (UTC) From: "Steve Loughran (Commented) (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: <395929680.8153.1317999210089.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <489103151.12345.1311782109715.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HDFS-2209) MiniDFS cluster improvements 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-2209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13122843#comment-13122843 ] Steve Loughran commented on HDFS-2209: -------------------------------------- +1. This makes MiniDFS much easier to embed and use in downstream test runs > MiniDFS cluster improvements > ---------------------------- > > Key: HDFS-2209 > URL: https://issues.apache.org/jira/browse/HDFS-2209 > Project: Hadoop HDFS > Issue Type: Improvement > Components: test > Affects Versions: 0.20.203.0 > Reporter: Steve Loughran > Assignee: Steve Loughran > Priority: Minor > Fix For: 0.24.0 > > Attachments: HDFS-2209.patch, HDFS-2209.patch, HDFS-2209.patch, HDFS-2209.patch, HDFS-2209.patch > > Original Estimate: 1h > Time Spent: 1.5h > Remaining Estimate: 2h > > I've been deploying MiniDFSCluster for some testing, and while using it/looking through the code I made some notes of where there are issues and improvement opportunities. This is mostly minor as its a test tool, but a risk of synchronization problems is there and does need addressing; the rest are all feature creep. > Field {{nameNode}} should be marked as volatile as the shutdown operation can be in a different thread than startup. Best of all, > add synchronized methods to set and get the field, as well as shutdown. > The data dir is set from from System Properties. > {code} > base_dir = new File(System.getProperty("test.build.data", "build/test/data"), "dfs/"); > data_dir = new File(base_dir, "data"); > {code} > This is done in {{formatDataNodeDirs()}} {{corruptBlockOnDataNode()}} and the constructor. > Improvement: have a test property in the conf file, and only read the system property if this is unset. This will enable > multiple MiniDFSClusters to come up in the same JVM, and handle shutdown/startup race conditions better, and avoid the > "java.io.IOException: Cannot lock storage build/test/data/dfs/name1. The directory is already locked." messages > Messages should log to the commons logging and not {{System.err}} and {{System.out}}. This enables containers to catch and stream better, > and include more diagnostics such as timestamp and thread Id > Class could benefit from a method to return the FS URI, rather than just the FS. This currently has to be worked around with some tricks involving a cached configuration > {{waitActive()}} could get confused if "localhost" maps to an IPv6 address. Better to ask for 127.0.0.1 as the hostname; Junit > test runs may need to be set up to force in IPv4 too. > {{injectBlocks}} has a spelling error in the IOException, "SumulatedFSDataset" is the correct spelling -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira