[ 
https://issues.apache.org/jira/browse/HDFS-13642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16504241#comment-16504241
 ] 

Xiao Chen commented on HDFS-13642:
----------------------------------

Hi Sammi, sorry I did not understand the last comment, mind further elaborate?

{{shouldReplicate}} seems to be an override that forces a file to be 
replication. {{FSDirWriteFileOp#addFile}} also works in favor of it.
{code}
 /**
   * Enforce the file to be a replicated file, no matter what its parent
   * directory's replication or erasure coding policy is.
   */
  SHOULD_REPLICATE((short) 0x80);
{code}


Regarding the original code, {{verifyReplication}} is called under either of 
the following 2 conditions
# shouldReplicate == true
# {{ecPolicyName}} is empty, and iip doesn't have a EC policy.

So in this patch, the {{shouldReplicate}} is kept.
For condition 2, there is a minor refactor to get ec policy from 
{{ecPolicyName}} and iip first. 
After that, the {{if (ecPolicy != null && (!ecPolicy.isReplicationPolicy()))}} 
check is the reverse of the previous condition 2, so 
{{blockManager.verifyReplication}} is called in the else here, essentially 
keeping current logic (with the added {{ecPolicy.isReplicationPolicy}} as 
discussed)

Could you please point out which part did I misunderstood?

> Creating a file with block size smaller than EC policy's cell size should 
> throw
> -------------------------------------------------------------------------------
>
>                 Key: HDFS-13642
>                 URL: https://issues.apache.org/jira/browse/HDFS-13642
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: erasure-coding
>    Affects Versions: 3.0.0
>            Reporter: Xiao Chen
>            Assignee: Xiao Chen
>            Priority: Major
>         Attachments: HDFS-13642.01.patch, HDFS-13642.02.patch, 
> HDFS-13642.03.patch, editsStored
>
>
> The following command causes an exception:
> {noformat}
> hadoop fs -Ddfs.block.size=349696 -put -f lineitem_sixblocks.parquet 
> /test-warehouse/tmp123ec
> {noformat}
> {noformat}
> 18/05/25 16:00:59 WARN hdfs.DataStreamer: DataStreamer Exception
> java.io.IOException: BlockSize 349696 < lastByteOffsetInBlock, #0: 
> blk_-9223372036854574256_14634, packet seqno: 7 offsetInBlock: 349696 
> lastPacketInBlock: false lastByteOffsetInBlock: 350208
>   at org.apache.hadoop.hdfs.DataStreamer.run(DataStreamer.java:729)
>   at 
> org.apache.hadoop.hdfs.StripedDataStreamer.run(StripedDataStreamer.java:46)
> 18/05/25 16:00:59 WARN hdfs.DFSOutputStream: Failed: offset=4096, length=512, 
> DFSStripedOutputStream:#0: failed, blk_-9223372036854574256_14634
> java.io.IOException: BlockSize 349696 < lastByteOffsetInBlock, #0: 
> blk_-9223372036854574256_14634, packet seqno: 7 offsetInBlock: 349696 
> lastPacketInBlock: false lastByteOffsetInBlock: 350208
>   at org.apache.hadoop.hdfs.DataStreamer.run(DataStreamer.java:729)
>   at 
> org.apache.hadoop.hdfs.StripedDataStreamer.run(StripedDataStreamer.java:46)
> {noformat}
> Then the streamer is confused and hangs.
> The local file is under 6MB, the hdfs file has a RS-3-2-1024k EC policy.
>  
> Credit to [~tarasbob] for reporting this issue.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to