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

Zsolt Venczel edited comment on HDFS-13846 at 8/24/18 10:15 AM:
----------------------------------------------------------------

Thanks [~knanasi] for creating this issue, I think it's a great catch!

In the description the term "node" is a bit confusing to me. These are the 
"real data blocks" you are referring to right?

I like how you extended the already available mocking approach in the unit 
tests.
 When I applied the test it was failing but it did pass with your proposed fix 
therefore I think it should be valid.

Overall I think it's a valid change, +1 (non-binding) from me.


was (Author: zvenczel):
Thanks [~knanasi] for creating this issue, I think it's a great catch!

In the description the term "node" is a bit confusing to me. These are the 
"real data blocks" you are referring to right?

I like how you extended the already available mocking approach in the unit 
tests.
When I applied the test they were failing but they did pass with your proposed 
fix therefore I think they should be valid.

Overall I think it's a valid change, +1 (non-binding) from me.

> Safe blocks counter is not decremented correctly if the block is striped
> ------------------------------------------------------------------------
>
>                 Key: HDFS-13846
>                 URL: https://issues.apache.org/jira/browse/HDFS-13846
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs
>    Affects Versions: 3.1.0
>            Reporter: Kitti Nanasi
>            Assignee: Kitti Nanasi
>            Priority: Major
>         Attachments: HDFS-13846.001.patch
>
>
> In BlockManagerSafeMode class, the "safe blocks" counter is incremented if 
> the number of nodes containing the block equals to the number of data units 
> specified by the erasure coding policy, which looks like this in the code:
> {code:java}
> final int safe = storedBlock.isStriped() ?
>         ((BlockInfoStriped)storedBlock).getRealDataBlockNum() : 
> safeReplication;
>     if (storageNum == safe) {
>       this.blockSafe++;
> {code}
> But when it is decremented the code does not check if the block is striped or 
> not, just compares the number of nodes containing the block with 0 
> (safeReplication - 1) if the block is complete, which is not correct.
> {code:java}
> if (storedBlock.isComplete() &&
>         blockManager.countNodes(b).liveReplicas() == safeReplication - 1) {
>       this.blockSafe--;
>       assert blockSafe >= 0;
>       checkSafeMode();
>     }
> {code}



--
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