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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.6.1
    • 2.8.0, 2.7.1, 3.0.0-alpha1
    • datanode
    • None
    • 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

              arp Arpit Agarwal
              arp Arpit Agarwal
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: