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

RBF: Fix Router Safemode check contidition error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.0
    • 3.4.0
    • rbf
    • Reviewed

    Description

      With HDFS-17116, Router safemode check contidition use monotonicNow(). 

      For code in  RouterSafemodeService.periodicInvoke()

      long now = monotonicNow();

      long cacheUpdateTime = stateStore.getCacheUpdateTime();
      boolean isCacheStale = (now - cacheUpdateTime) > this.staleInterval;

       

      Function monotonicNow() is implemented with System.nanoTime(). 

      System.nanoTime() in javadoc description:

      This method can only be used to measure elapsed time and is not related to any other notion of system or wall-clock time. The value returned represents nanoseconds since some fixed but arbitrary origin time (perhaps in the future, so values may be negative). 

       

      The following situation maybe exists :

      If refreshCaches not success in the beginning, cacheUpdateTime will be 0 , and now - cacheUpdateTime is arbitrary origin time,so isCacheStale maybe  be true or false. 

      Attachments

        Issue Links

          Activity

            People

              liuguanghua liuguanghua
              liuguanghua liuguanghua
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: