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

Avoid redefinition of storageDirs in NNStorage and cleanup its accessors in Storage

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0-alpha1
    • Fix Version/s: 2.9.0, 3.0.0-alpha2
    • Component/s: None
    • Labels:
      None

      Description

      In the abstract class Storage, storageDirs is a protected variable and all its derived classes like NNStorage, JNStorage, DataStorage.. are iterating over this non-thread safe variable without any proper locks. Any parallel modification operation like add or remove volume can mutate the backing storageDirs list and any iterators on this list around the same time can face ConcurrentModificationException. It would be good to make the variable private and restrict the access via getters and setters. Any thread safe restriction need to be done can then be placed on the parent class only.

      Also, NNStorage redefines parent class Storage's storageDirs, making it inconsistent with other derived classes. Would be cleaner if NNStorage can avoid re-defining it locally.

        Attachments

        1. HDFS-11267.03.patch
          9 kB
          Lei (Eddy) Xu
        2. HDFS-11267.02.patch
          10 kB
          Manoj Govindassamy
        3. HDFS-11267.01.patch
          10 kB
          Manoj Govindassamy

          Activity

            People

            • Assignee:
              manojg Manoj Govindassamy
              Reporter:
              manojg Manoj Govindassamy
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: