XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      Here we found a bad case with datanode reserved space:

      Say we have 1TB volume and 500GB reserved space configed, e.g. /data1:500GB.

      So we intend to reserve this 500GB to another app, e.g. yarn, then yarn consumed all 500GB.

      Then we found that the available space of ozone is 0, which is not intended.

      The root cause is the following piece:

       

      // VolumeInfo.java
      public long getAvailable() {
       return Math.max(usage.getAvailable() - reservedInBytes, 0);
      }
      ...
      // VolumeUsage.java
      public long getAvailable() {
        long l = source.getCapacity() - source.getUsedSpace();         // 1TB - 500GB = 500GB
        return Math.max(Math.min(l, source.getAvailable()), 0);
      }

       

      Here usage.getAvailable() will return 500GB, and it should not sub reservedInBytes there otherwise it produces a 0.

      The reservedInBytes should only be sub at `getCapacity()`.

      Attachments

        Issue Links

          Activity

            People

              markgui Mark Gui
              markgui Mark Gui
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: