ZanderXu commented on PR #5500: URL: https://github.com/apache/hadoop/pull/5500#issuecomment-1478887815
> I found that when `BlockManager#removeBRLeaseIfNeeded` is called, `BlockManager#checkBlockReportLease` must have been called in advance. `BlockManager#checkBlockReportLease` already checked whether the `nodeID` exists in `datanodeManager`, is it necessary for us to check it again in `BlockManager#removeBRLeaseIfNeeded`? > > https://github.com/apache/hadoop/blob/67e02a92e0b9c4da3dcdd01f231a98f243f12d06/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java#L2851-L2859 @zhangshuyan0 Thanks for your review. I think we should check it again in `BlockManager#removeBRLeaseIfNeeded`, because there is a segment lock that `bm.processReport()` will unlock the write and `BlockManager#removeBRLeaseIfNeeded` hold the lock again. And there is a case that the datanode is removed after `bm.processReport()` and before `BlockManager#removeBRLeaseIfNeeded`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
