Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-775

FSDataset calls getCapacity() twice -bug?

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.22.0
    • Fix Version/s: 0.21.0
    • Component/s: datanode
    • Labels:
      None

      Description

      I'm not sure this is a bug or "as intended", but I thought I'd mention it.

      FSDataset.getCapacity() calls DF.getCapacity() twice, when evaluating its capacity. Although there is caching to stop the shell being exec'd twice in a row, there is a risk that the first call doesn't run the shell, and the second does -so the value changes during the method.

      If that is not intended, it is better to cache the first value for the whole method

      1. HDFS-775-1.patch
        0.9 kB
        steve_l
      2. HDFS-775-2.patch
        0.9 kB
        steve_l

        Activity

        steve_l created issue -
        steve_l made changes -
        Field Original Value New Value
        Priority Major [ 3 ] Minor [ 4 ]
        steve_l made changes -
        Attachment HDFS-775-1.patch [ 12427472 ]
        steve_l made changes -
        Attachment HDFS-775-2.patch [ 12427479 ]
        steve_l made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Fix Version/s 0.22.0 [ 12314241 ]
        steve_l made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Assignee Steve Loughran [ steve_l ]
        Resolution Fixed [ 1 ]
        Gavin made changes -
        Reporter Steve Loughran [ steve_l ] Steve Loughran [ stevel@apache.org ]
        Gavin made changes -
        Assignee Steve Loughran [ steve_l ] Steve Loughran [ stevel@apache.org ]
        Tom White made changes -
        Fix Version/s 0.21.0 [ 12314046 ]
        Fix Version/s 0.22.0 [ 12314241 ]
        Tom White made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Steve Loughran
            Reporter:
            Steve Loughran
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development