Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-6582

FSAppAttempt demand can be updated atomically in updateDemand()

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9.0, 3.0.0-alpha4
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      FSAppAttempt#updateDemand first sets demand to 0, and then adds up all the outstanding requests. Instead, we could use another variable tmpDemand to build the new value and atomically replace the demand.

      1. YARN-6582.001.patch
        2 kB
        Karthik Kambatla

        Activity

        Hide
        kasha Karthik Kambatla added a comment -

        Uploading patch to improve this:

        1. Use a new variable tmpDemand to build the value of demand.
        2. App's schedulerKeys are in a ConcurrentSkipList, so there is no need for a lock.
        3. Assign tmpDemand to demand in one go. This is safe: a previous access to demand is stale, but that is expected. And, there are no locks held on demand.
        Show
        kasha Karthik Kambatla added a comment - Uploading patch to improve this: Use a new variable tmpDemand to build the value of demand. App's schedulerKeys are in a ConcurrentSkipList, so there is no need for a lock. Assign tmpDemand to demand in one go. This is safe: a previous access to demand is stale, but that is expected. And, there are no locks held on demand.
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 14s Docker mode activated.
        +1 @author 0m 0s The patch does not contain any @author tags.
        -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
        +1 mvninstall 13m 31s trunk passed
        +1 compile 0m 34s trunk passed
        +1 checkstyle 0m 25s trunk passed
        +1 mvnsite 0m 36s trunk passed
        +1 mvneclipse 0m 18s trunk passed
        +1 findbugs 1m 2s trunk passed
        +1 javadoc 0m 22s trunk passed
        +1 mvninstall 0m 39s the patch passed
        +1 compile 0m 33s the patch passed
        +1 javac 0m 33s the patch passed
        +1 checkstyle 0m 23s the patch passed
        +1 mvnsite 0m 34s the patch passed
        +1 mvneclipse 0m 16s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 1m 7s the patch passed
        +1 javadoc 0m 23s the patch passed
        +1 unit 41m 12s hadoop-yarn-server-resourcemanager in the patch passed.
        +1 asflicense 0m 19s The patch does not generate ASF License warnings.
        63m 47s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:14b5c93
        JIRA Issue YARN-6582
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12867475/YARN-6582.001.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux fc70daf4025e 3.13.0-107-generic #154-Ubuntu SMP Tue Dec 20 09:57:27 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / eed7314
        Default Java 1.8.0_121
        findbugs v3.1.0-RC1
        Test Results https://builds.apache.org/job/PreCommit-YARN-Build/15901/testReport/
        modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager
        Console output https://builds.apache.org/job/PreCommit-YARN-Build/15901/console
        Powered by Apache Yetus 0.5.0-SNAPSHOT http://yetus.apache.org

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 reexec 0m 14s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 mvninstall 13m 31s trunk passed +1 compile 0m 34s trunk passed +1 checkstyle 0m 25s trunk passed +1 mvnsite 0m 36s trunk passed +1 mvneclipse 0m 18s trunk passed +1 findbugs 1m 2s trunk passed +1 javadoc 0m 22s trunk passed +1 mvninstall 0m 39s the patch passed +1 compile 0m 33s the patch passed +1 javac 0m 33s the patch passed +1 checkstyle 0m 23s the patch passed +1 mvnsite 0m 34s the patch passed +1 mvneclipse 0m 16s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 7s the patch passed +1 javadoc 0m 23s the patch passed +1 unit 41m 12s hadoop-yarn-server-resourcemanager in the patch passed. +1 asflicense 0m 19s The patch does not generate ASF License warnings. 63m 47s Subsystem Report/Notes Docker Image:yetus/hadoop:14b5c93 JIRA Issue YARN-6582 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12867475/YARN-6582.001.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux fc70daf4025e 3.13.0-107-generic #154-Ubuntu SMP Tue Dec 20 09:57:27 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / eed7314 Default Java 1.8.0_121 findbugs v3.1.0-RC1 Test Results https://builds.apache.org/job/PreCommit-YARN-Build/15901/testReport/ modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager Console output https://builds.apache.org/job/PreCommit-YARN-Build/15901/console Powered by Apache Yetus 0.5.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        kasha Karthik Kambatla added a comment -

        The patch doesn't change the behavior, hence no tests.

        Show
        kasha Karthik Kambatla added a comment - The patch doesn't change the behavior, hence no tests.
        Hide
        yufeigu Yufei Gu added a comment -

        Thanks Karthik Kambatla for working on this. The patch looks good to me. Both getSchedulerKeys() and getPendingAsk are fine after removing the write lock. +1.

        Show
        yufeigu Yufei Gu added a comment - Thanks Karthik Kambatla for working on this. The patch looks good to me. Both getSchedulerKeys() and getPendingAsk are fine after removing the write lock. +1.
        Hide
        yufeigu Yufei Gu added a comment -

        Committed to trunk and branch-2. Thanks Karthik Kambatla for the patch.

        Show
        yufeigu Yufei Gu added a comment - Committed to trunk and branch-2. Thanks Karthik Kambatla for the patch.
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #11784 (See https://builds.apache.org/job/Hadoop-trunk-Commit/11784/)
        YARN-6582. FSAppAttempt demand can be updated atomically in (yufei: rev 87590090c887829e874a7132be9cf8de061437d6)

        • (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSAppAttempt.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #11784 (See https://builds.apache.org/job/Hadoop-trunk-Commit/11784/ ) YARN-6582 . FSAppAttempt demand can be updated atomically in (yufei: rev 87590090c887829e874a7132be9cf8de061437d6) (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSAppAttempt.java

          People

          • Assignee:
            kasha Karthik Kambatla
            Reporter:
            kasha Karthik Kambatla
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development