Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-7365

AppMaster register UAM can lost application priority in subCluster

    XMLWordPrintableJSON

Details

    Description

      AppMaster register uam to subCluster can lost application priority in yarn federation cluster.Which make the subCluster's RM allocate resouce to application use default priority regardless of the application's real priority.

      By analyzing the code, I found that the appMaster submitApplication to subCluster did't set the priority to ApplicationSubmissionContext. As follows:

       

      private void submitUnmanagedApp(ApplicationId appId)
       throws YarnException, IOException {
       SubmitApplicationRequest submitRequest =
       this.recordFactory.newRecordInstance(SubmitApplicationRequest.class);
      ApplicationSubmissionContext context = this.recordFactory
       .newRecordInstance(ApplicationSubmissionContext.class);
      context.setApplicationId(appId);
       context.setApplicationName(APP_NAME + "-" + appNameSuffix);
       if (StringUtils.isBlank(this.queueName)) {
       context.setQueue(this.conf.get(DEFAULT_QUEUE_CONFIG,
       YarnConfiguration.DEFAULT_QUEUE_NAME));
       } else {
       context.setQueue(this.queueName);
       }
      ContainerLaunchContext amContainer =
       this.recordFactory.newRecordInstance(ContainerLaunchContext.class);
       Resource resource = BuilderUtils.newResource(1024, 1);
       context.setResource(resource);
       context.setAMContainerSpec(amContainer);
       submitRequest.setApplicationSubmissionContext(context);
      context.setUnmanagedAM(true);
       context.setKeepContainersAcrossApplicationAttempts(
       this.keepContainersAcrossApplicationAttempts);
      LOG.info("Submitting unmanaged application {}", appId);
       this.rmClient.submitApplication(submitRequest);
       }
      

      Finnally, I fixed this by set application's priority to the ApplicationSubmissionContext.  The priority which from the homeCluster's response when register appMaster to homeCluster's RM.

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            yaoguangdong Yao Guangdong
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: