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

Setting dfs.mover.retry.max.attempts to negative value will retry forever.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.3.1, 3.4.0, 3.2.3
    • balancer & mover
    • None
    • Reviewed

    Description

      Configuration parameter "dfs.mover.retry.max.attempts" is to define the maximum number of retries before the mover consider the move failed. There is no checking code so this parameter can accept any int value.

      Theoratically, setting this value to <=0 should mean that no retry at all. However, if you set the value to negative value. The checking condition for retry failed will never satisfied because the if statement is "if (retryCount.get() == retryMaxAttempts)". The retry count will always +1 by retryCount.incrementAndGet() after failed but never = retryMaxAttempts. 

      private Result processNamespace() throws IOException {
            ... //wait for pending move to finish and retry the failed migration
            if (hasFailed && !hasSuccess) {
              if (retryCount.get() == retryMaxAttempts) {
                result.setRetryFailed();
                LOG.error("Failed to move some block's after "
                    + retryMaxAttempts + " retries.");
                return result;
              } else {
                retryCount.incrementAndGet();
              }
            } else {
              // Reset retry count if no failure.
              retryCount.set(0);
            }
            ...
          }
      

      How to fix

      Add checking code of "dfs.mover.retry.max.attempts" to accept only non-negative value or change the if statement condition when retry count exceeds max attempts.

      Attachments

        1. HDFS-15439.000.patch
          0.9 kB
          AMC-team
        2. HDFS-15439.001.patch
          2 kB
          AMC-team
        3. HDFS-15439.002.patch
          1 kB
          AMC-team

        Activity

          People

            AMC-team AMC-team
            AMC-team AMC-team
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: