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

ASF GitHub Bot commented on HDFS-17050:
---------------------------------------

hfutatzhanghb commented on code in PR #5753:
URL: https://github.com/apache/hadoop/pull/5753#discussion_r1235075644


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockInfoStriped.java:
##########
@@ -128,8 +128,25 @@ boolean addStorage(DatanodeStorageInfo storage, Block 
reportedBlock) {
     DatanodeStorageInfo old = getStorageInfo(index);
     if (old != null && !old.equals(storage)) { // over replicated
       // check if the storage has been stored
+      boolean blockIdNotEquals = false;
+      long blockGroupId = 
BlockIdManager.convertToStripedID(reportedBlock.getBlockId() - blockIndex);
+      Iterator<BlockInfo> blockIterator = old.getBlockIterator();
+      while (blockIterator.hasNext()) {
+        BlockInfo blockInfo = blockIterator.next();
+        if (!blockInfo.isStriped()) {
+          continue;
+        } else {
+          if (BlockIdManager.convertToStripedID(blockInfo.getBlockId()) == 
blockGroupId) {
+            Block blockOnOldStorage = ((BlockInfoStriped) 
blockInfo).getBlockOnStorage(old);
+            if (blockOnOldStorage.getBlockId() != reportedBlock.getBlockId()) {
+              blockIdNotEquals = true;

Review Comment:
   @zhangshuyan0  Thanks shuyan for your reviewing, this PR still has some 
problems, I will fix it soonly and push it.  I think it is efficent for us to 
disscuss after then.





> Erasure coding: fix bug for invalidating duplicated block when two ec block 
> at the same datanode but different storage.
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-17050
>                 URL: https://issues.apache.org/jira/browse/HDFS-17050
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 3.4.0, 3.3.2
>            Reporter: farmmamba
>            Assignee: farmmamba
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: image-2023-06-16-15-32-05-123.png
>
>
> Currently, I found a strange phenomenon mentioned in HDFS-17047.
> When triggered FBR manually or automatically, we found some warn log like 
> below:
> {code:java}
> 2023-06-14 16:29:36,432 WARN BlockStateChange: BLOCK* addStoredBlock: block 
> blk_-9223372036578646784_59354864 moved to storageType DISK on node 
> datanode12:50010
> 2023-06-14 16:29:36,477 WARN BlockStateChange: BLOCK* addStoredBlock: block 
> blk_-9223372036578646784_59354864 moved to storageType DISK on node 
> datanode12:50010{code}
> The above logs print the same storedBlock two times. After diving into logs, 
> I found that there exist two blocks of a same block group due to some unknown 
> reasons. And one of the two blocks is also exists in other datanode. But fsck 
> did not print the duplicated replicas info.
> additional information: the file is 3MB+,  we use RS-6-3-1024K, so the fsck 
> only print seven blocks information. But indeed, we have eight blocks and one 
> of them is a duplicated block.
>  
> The reason why print above logs is that:
> In BlockManager#addStoredBlock method, because a datanode has two blocks of 
> the same block group, the AddBlockResult would be REPLACED.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to