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 DB2C719E95 for ; Mon, 18 Apr 2016 20:48:30 +0000 (UTC) Received: (qmail 62695 invoked by uid 500); 18 Apr 2016 20:48:25 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 62635 invoked by uid 500); 18 Apr 2016 20:48:25 -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 62595 invoked by uid 99); 18 Apr 2016 20:48:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Apr 2016 20:48:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 76D0E2C1F5C for ; Mon, 18 Apr 2016 20:48:25 +0000 (UTC) Date: Mon, 18 Apr 2016 20:48:25 +0000 (UTC) From: "Colin Patrick McCabe (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-10265) OEV tool fails to read edit xml file if OP_UPDATE_BLOCKS has no BLOCK tag 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-10265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15246503#comment-15246503 ] Colin Patrick McCabe commented on HDFS-10265: --------------------------------------------- +1. Thanks, [~wanchang]. > OEV tool fails to read edit xml file if OP_UPDATE_BLOCKS has no BLOCK tag > ------------------------------------------------------------------------- > > Key: HDFS-10265 > URL: https://issues.apache.org/jira/browse/HDFS-10265 > Project: Hadoop HDFS > Issue Type: Bug > Components: tools > Affects Versions: 2.4.1, 2.7.1 > Reporter: Wan Chang > Assignee: Wan Chang > Priority: Minor > Labels: patch > Attachments: HDFS-10265-001.patch, HDFS-10265-002.patch > > > I use OEV tool to convert editlog to xml file, then convert the xml file back to binary editslog file(so that low version NameNode can load edits that generated by higher version NameNode). But when OP_UPDATE_BLOCKS has no BLOCK tag, the OEV tool doesn't handle the case and exits with InvalidXmlException. > Here is the stack: > {code} > fromXml error decoding opcode null > {{"/tmp/100M3/slive/data/subDir_13/subDir_7/subDir_15/subDir_11/subFile_5"}, {"-2"}, {}, > {"3875711"}} > Encountered exception. Exiting: no entry found for BLOCK > org.apache.hadoop.hdfs.util.XMLUtils$InvalidXmlException: no entry found for BLOCK > at org.apache.hadoop.hdfs.util.XMLUtils$Stanza.getChildren(XMLUtils.java:242) > at org.apache.hadoop.hdfs.server.namenode.FSEditLogOp$UpdateBlocksOp.fromXml(FSEditLogOp.java:908) > at org.apache.hadoop.hdfs.server.namenode.FSEditLogOp.decodeXml(FSEditLogOp.java:3942) > ... > {code} > Here is part of the xml file: > {code} > > OP_UPDATE_BLOCKS > > 3875711 > /tmp/100M3/slive/data/subDir_13/subDir_7/subDir_15/subDir_11/subFile_5 > > -2 > > > {code} > I tracked the NN's log and found those operation: > 0. The file /tmp/100M3/slive/data/subDir_13/subDir_7/subDir_15/subDir_11/subFile_5 is very small and contains only one block. > 1. Client ask NN to add block to the file. > 2. Client failed to write to DN and asked NameNode to abandon block. > 3. NN remove the block and write an OP_UPDATE_BLOCKS to editlog > Finally NN generated a OP_UPDATE_BLOCKS with no BLOCK tags. > In FSEditLogOp$UpdateBlocksOp.fromXml, we need to handle the case above. -- This message was sent by Atlassian JIRA (v6.3.4#6332)