[
https://issues.apache.org/jira/browse/HDFS-12639?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17681706#comment-17681706
]
姚凡 commented on HDFS-12639:
---------------------------
I had the same problem,processCommandFromActor method will hold write lock.
!image-2023-01-29-17-18-21-014.png|width=532,height=256!
When a large number of files are deleted, the deletion of a batch of blocks is
slow due to OS or other factors. and will block
updateActorStatesFromHeartbeat and IBR.
!image-2023-01-29-17-27-15-076.png|width=790,height=72!
!image-2023-01-29-17-23-42-979.png|width=786,height=181!
!image-2023-01-29-17-20-59-350.png|width=492,height=308!
processCommandFromActor hold lock Is necessary ?
> BPOfferService lock may stall all service actors
> ------------------------------------------------
>
> Key: HDFS-12639
> URL: https://issues.apache.org/jira/browse/HDFS-12639
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: datanode
> Affects Versions: 2.8.0
> Reporter: Daryn Sharp
> Assignee: Hanisha Koneru
> Priority: Major
>
> {{BPOfferService}} manages {{BPServiceActor}} instances for the active and
> standby. It uses a RW lock to primarily protect registration information
> while determining the active/standby from heartbeats.
> Unfortunately the write lock is held during command processing. If an actor
> is experiencing high latency processing commands, the other actor will
> neither be able to register (blocked in createRegistration, setNamespaceInfo,
> verifyAndSetNamespaceInfo) nor process heartbeats (blocked in
> updateActorStatesFromHeartbeat).
> The worst case scenario for processing commands while holding the lock is
> re-registration. The actor will loop, catching and logging exceptions,
> leaving the other actor blocked for an non-deterministic (possibly infinite)
> amount of time.
> The lock must not be held during command processing.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]