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

RBF: Improve RouterWebhdfsMethods#chooseDatanode() error handling

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Not A Problem
    • None
    • None
    • None
    • None

    Description

      HDFS-13972 added the following code:

      try {
            dns = rpcServer.getDatanodeReport(DatanodeReportType.LIVE);
          } catch (IOException e) {
            LOG.error("Cannot get the datanodes from the RPC server", e);
          } finally {
            // Reset ugi to remote user for remaining operations.
            RouterRpcServer.resetCurrentUser();
          }
      
          HashSet<Node> excludes = new HashSet<Node>();
          if (excludeDatanodes != null) {
            Collection<String> collection =
                getTrimmedStringCollection(excludeDatanodes);
            for (DatanodeInfo dn : dns) {
              if (collection.contains(dn.getName())) {
                excludes.add(dn);
              }
            }
          }
      

      If rpcServer.getDatanodeReport() throws an exception, dns will become null. This does't look like the best way to handle the exception. Should router retry upon exception? Does it perform retry automatically under the hood?

      crh brahmareddy

      Attachments

        Activity

          People

            crh CR Hota
            weichiu Wei-Chiu Chuang
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: