You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Wei-Chiu Chuang (JIRA)" <ji...@apache.org> on 2019/08/16 21:54:00 UTC

[jira] [Updated] (HDFS-14456) HAState#prepareToEnterState needn't a lock

     [ https://issues.apache.org/jira/browse/HDFS-14456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wei-Chiu Chuang updated HDFS-14456:
-----------------------------------
       Resolution: Fixed
    Fix Version/s: 3.3.0
           Status: Resolved  (was: Patch Available)

PR was merged. Resolve this jira. Thanks [~hunhun]!

> HAState#prepareToEnterState needn't a lock
> ------------------------------------------
>
>                 Key: HDFS-14456
>                 URL: https://issues.apache.org/jira/browse/HDFS-14456
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs
>    Affects Versions: 3.2.0
>            Reporter: hunshenshi
>            Assignee: hunshenshi
>            Priority: Major
>             Fix For: 3.3.0
>
>
> prepareToEnterState in HAState is called without the context being locked.
> But in NameNode#NameNode, prepareToEnterState is after haContext.writeLock()
>  
> {code:java}
> try {
>   haContext.writeLock();
>   state.prepareToEnterState(haContext);
>   state.enterState(haContext);
> } finally {
>   haContext.writeUnlock();
> }
> {code}
>  
> Is it OK?
>  



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org