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

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

Log workAgile BoardRank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0-alpha1
    • 2.9.0, 3.0.0-alpha2
    • None
    • 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.01.patch
          10 kB
          Manoj Govindassamy
        2. HDFS-11267.02.patch
          10 kB
          Manoj Govindassamy
        3. HDFS-11267.03.patch
          9 kB
          Lei (Eddy) Xu

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            manojg Manoj Govindassamy Assign to me
            manojg Manoj Govindassamy
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment