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

Using monotonicNow for block report scheduling causes test failures on recently restarted systems

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.6.1
    • Fix Version/s: 2.8.0, 2.7.1, 3.0.0-alpha1
    • Component/s: datanode
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      BPServiceActor#blockReport has the following check:

        List<DatanodeCommand> blockReport() throws IOException {
          // send block report if timer has expired.
          final long startTime = monotonicNow();
          if (startTime - lastBlockReport <= dnConf.blockReportInterval) {
            return null;
          }
      

      Many tests trigger an immediate block report via BPServiceActor#triggerBlockReportForTests which sets lastBlockReport = 0. However if the machine was restarted recently then startTime may be less than dnConf.blockReportInterval and the block report is not sent.

      Time#monotonicNow uses System#nanoTime which represents time elapsed since an arbitrary origin. The time should be used only for comparison with other values returned by System#nanoTime.

        Attachments

        1. HDFS-8163.01.patch
          4 kB
          Arpit Agarwal
        2. HDFS-8163.02.patch
          14 kB
          Arpit Agarwal
        3. HDFS-8163.03.patch
          20 kB
          Arpit Agarwal

          Issue Links

            Activity

              People

              • Assignee:
                arpitagarwal Arpit Agarwal
                Reporter:
                arpitagarwal Arpit Agarwal
              • Votes:
                0 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: