[ 
https://issues.apache.org/jira/browse/HDFS-16537?focusedWorklogId=757667&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-757667
 ]

ASF GitHub Bot logged work on HDFS-16537:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 17/Apr/22 12:41
            Start Date: 17/Apr/22 12:41
    Worklog Time Spent: 10m 
      Work Description: Hexiaoqiao commented on code in PR #4160:
URL: https://github.com/apache/hadoop/pull/4160#discussion_r851750553


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogOp.java:
##########
@@ -2946,7 +2946,7 @@ void fromXml(Stanza st) throws InvalidXmlException {
       this.newLength = Long.parseLong(st.getValue("NEWLENGTH"));
       this.timestamp = Long.parseLong(st.getValue("TIMESTAMP"));
       if (st.hasChildren("BLOCK"))
-        this.truncateBlock = FSEditLogOp.blockFromXml(st);
+        this.truncateBlock = 
FSEditLogOp.blockFromXml(st.getChildren("BLOCK").get(0));

Review Comment:
   After another review, I think it is proper now. Do you mind to add new unit 
test to cover this case?





Issue Time Tracking
-------------------

    Worklog Id:     (was: 757667)
    Time Spent: 50m  (was: 40m)

> oev parse error  when we have truncate operate
> ----------------------------------------------
>
>                 Key: HDFS-16537
>                 URL: https://issues.apache.org/jira/browse/HDFS-16537
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: hdfs
>    Affects Versions: 3.3.2
>            Reporter: guophilipse
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: image-2022-04-11-17-33-46-669.png
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> hi ,when we use oev tool to parse  xml to fsimage file , and the xml contains 
>  OP_TRUNCATE ,the decode parse will fail with the following error
> !image-2022-04-11-17-33-46-669.png!
> the truncate record example as the following.
> <RECORD>
> <OPCODE>OP_TRUNCATE</OPCODE>
> <DATA>
> <TXID>4169074186</TXID>
> <SRC>/data/test/2022/03/24/part-9-123</SRC>
> <CLIENTNAME>DFSClient_NONMAPREDUCE_2025317379_1</CLIENTNAME>
> <CLIENTMACHINE>192.168.1.1</CLIENTMACHINE>
> <NEWLENGTH>3462890</NEWLENGTH>
> <TIMESTAMP>1648094066932</TIMESTAMP>
> <BLOCK>
>     <BLOCK_ID>1369315031</BLOCK_ID>
>     <NUM_BYTES>0</NUM_BYTES>
>     <GENSTAMP>296479647</GENSTAMP>
> </BLOCK>
> </DATA>
> </RECORD>
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to