Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-4014 Fix warnings found by findbugs2
  3. HDFS-4030

BlockManager excessBlocksCount and postponedMisreplicatedBlocksCount should be AtomicLongs

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0-alpha
    • 2.0.3-alpha
    • namenode
    • None
    • Reviewed

    Description

      The BlockManager excessBlocksCount and postponedMisreplicatedBlocksCount fields are currently volatile longs which are incremented, which isn't thread safe. It looks like they're always incremented on paths that hold the NN write lock but it would be easier and less error prone for future changes if we made them AtomicLongs. The other volatile long members are just set in one thread and read in another so they're fine as is.

      Attachments

        1. hdfs-4030.txt
          4 kB
          Eli Collins
        2. hdfs-4030.txt
          4 kB
          Eli Collins

        Activity

          People

            eli Eli Collins
            eli Eli Collins
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: