Thank you for your review and comments, Jing Zhao and Manoj Govindassamy! I uploaded a new patch.
BlockUnderConstructionFeature#getExpectedStorageLocationsIterator() is not a thread safe iterator. Quite a few scenarios can update storage replicas under construction and iterating over this array without any protection can lead to crash. The window could be very very narrow, but there is always a chance of hitting this race. Your thoughts on this please ?
Thanks, that's a good point. In this case, while the loop is running, storagesItr in NamenodeFsck#getReplicaInfo keeps having the reference of the iterator and it is not affected by BlockInfo.convertToCompleteBlock. So I think it is the same risk as that of BlockUnderConstructionFeature#getExpectedStorageLocations() at least. If we should make it more thread-safe, it would be good to discuss it in a separate jira.