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

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

liubingxing commented on PR #4943:
URL: https://github.com/apache/hadoop/pull/4943#issuecomment-1260707194

   @sodonnel Thank you for your detailed explanation. I forgot to check the 
conditions here, and the write lock is not needed.
   ``` java
   if (!isBlockReplicatedOk(dn, b, false, null)) {
       blockList.put(b, null);
   }
   ```
   I will close this PR. Thanks again.




> replace readLock with writeLock in 
> #DatanodeAdminBackoffMonitor.scanDatanodeStorage
> -----------------------------------------------------------------------------------
>
>                 Key: HDFS-16784
>                 URL: https://issues.apache.org/jira/browse/HDFS-16784
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: qinyuren
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: image-2022-09-28-15-37-24-622.png
>
>
> In #DatanodeAdminBackoffMonitor.scanDatanodeStorage, it uses a read lock to 
> protect the function #isBlockReplicatedOk.
> But we found that the function #isBlockReplicatedOk may update the 
> #neededReconstruction under certain conditions.
> !image-2022-09-28-15-37-24-622.png!
> Should we replace the read lock with write lock?



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