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 7008A17634 for ; Fri, 20 Mar 2015 17:51:37 +0000 (UTC) Received: (qmail 79236 invoked by uid 500); 20 Mar 2015 17:50:39 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 79188 invoked by uid 500); 20 Mar 2015 17:50:39 -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 79176 invoked by uid 99); 20 Mar 2015 17:50:39 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Mar 2015 17:50:39 +0000 Date: Fri, 20 Mar 2015 17:50:38 +0000 (UTC) From: "Lei (Eddy) Xu (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HDFS-7917) Use file to replace data dirs in test to simulate a disk failure. 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-7917?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lei (Eddy) Xu updated HDFS-7917: -------------------------------- Status: Patch Available (was: Open) trigger jenkins build > Use file to replace data dirs in test to simulate a disk failure. > ------------------------------------------------------------------ > > Key: HDFS-7917 > URL: https://issues.apache.org/jira/browse/HDFS-7917 > Project: Hadoop HDFS > Issue Type: Improvement > Components: test > Affects Versions: 2.6.0 > Reporter: Lei (Eddy) Xu > Assignee: Lei (Eddy) Xu > Priority: Minor > Attachments: HDFS-7917.000.patch > > > Currently, in several tests, e.g., {{TestDataNodeVolumeFailureXXX}} and {{TestDataNotHowSwapVolumes}}, we simulate a disk failure by setting a directory's executable permission as false. However, it raises the risk that if the cleanup code could not be executed, the directory can not be easily removed by Jenkins job. > Since in {{DiskChecker#checkDirAccess}}: > {code} > private static void checkDirAccess(File dir) throws DiskErrorException { > if (!dir.isDirectory()) { > throw new DiskErrorException("Not a directory: " > + dir.toString()); > } > checkAccessByFileMethods(dir); > } > {code} > We can replace the DN data directory as a file to achieve the same fault injection goal, while it is safer for cleaning up in any circumstance. Additionally, as [~cnauroth] suggested: > bq. That might even let us enable some of these tests that are skipped on Windows, because Windows allows access for the owner even after permissions have been stripped. -- This message was sent by Atlassian JIRA (v6.3.4#6332)