Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-1672

Improve locking in OzoneManager

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Done

    Description

      In this Jira, we shall follow the new lock ordering. In this way, in volume requests we can solve the issue of acquire/release/reacquire problem. And few bugs in the current implementation of S3Bucket/Volume operations.

       

      Currently after acquiring volume lock, we cannot acquire user lock. 

      This is causing an issue in Volume request implementation, acquire/release/reacquire volume lock.

       

      Case of Delete Volume Request: 

      1. Acquire volume lock.
      2. Get Volume Info from DB
      3. Release Volume lock. (We are releasing the lock, because while acquiring volume lock, we cannot acquire user lock0
      4. Get owner from volume Info read from DB
      5. Acquire owner lock
      6. Acquire volume lock
      7. Do delete logic
      8. release volume lock
      9. release user lock

       

      We can avoid this acquire/release/reacquire lock issue by making volume lock as low weight. 

       

      In this way, the above deleteVolume request will change as below

      1. Acquire volume lock
      2. Get Volume Info from DB
      3. Get owner from volume Info read from DB
      4. Acquire owner lock
      5. Do delete logic
      6. release owner lock
      7. release volume lock. 

      Same issue is seen with SetOwner for Volume request also.

      During HDDS-1620 Arpit Agarwal brought up this issue. 

      I am proposing the above solution to solve this issue. Any other idea/suggestions are welcome.

      This also resolves a bug in setOwner for Volume request.

      Attachments

        Issue Links

        Activity

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

          People

            bharat Bharat Viswanadham
            bharat Bharat Viswanadham
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 18h 40m
                18h 40m

                Agile

                  Active Sprint:
                  Done ends 23/Aug/19
                  View on Board

                  Slack

                    Issue deployment