Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-14456

HAState#prepareToEnterState needn't a lock

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.2.0
    • Fix Version/s: 3.3.0
    • Component/s: hdfs
    • Labels:
      None

      Description

      prepareToEnterState in HAState is called without the context being locked.

      But in NameNode#NameNode, prepareToEnterState is after haContext.writeLock()

       

      try {
        haContext.writeLock();
        state.prepareToEnterState(haContext);
        state.enterState(haContext);
      } finally {
        haContext.writeUnlock();
      }
      

       

      Is it OK?

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hunhun hunshenshi
                Reporter:
                hunhun hunshenshi
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: