[ 
https://issues.apache.org/jira/browse/YARN-11290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17601052#comment-17601052
 ] 

ASF GitHub Bot commented on YARN-11290:
---------------------------------------

slfan1989 commented on code in PR #4846:
URL: https://github.com/apache/hadoop/pull/4846#discussion_r964252561


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/clientrm/FederationClientInterceptor.java:
##########
@@ -949,7 +949,7 @@ public ReservationSubmissionResponse submitReservation(
         // Second, determine whether the current ReservationId has a 
corresponding subCluster.
         // If it does not exist, add it. If it exists, update it.
         Boolean exists = existsReservationHomeSubCluster(reservationId);
-        if (!exists) {
+        if (!exists || i == 0) {

Review Comment:
   Reservation may be repeatedly submitted (the same reservationId is submitted 
repeatedly). At this time, we should try to use the first reservation result. 
If the first reservation encounters some abnormalities, find another RM for 
reservation.
   
   If a reservationId(**reservationId_1**) has successfully applied for 
reserved resources in SC_1, and the **reservationId_1** is submitted 
repeatedly, we should try to use the allocation result of SC_1
   
   For the case of **reservationId_1**, the following code will return true, 
   ```
   Boolean exists = existsReservationHomeSubCluster(reservationId);
   ```
   
   Then the first subcluster(SC_1) will be used instead of SC2
   ```
   updateReservationHomeSubCluster(subClusterId, reservationId, 
reservationHomeSubCluster);
   ```
   
   But at this time we still want to go 
`addReservationHomeSubCluster(reservationId, reservationHomeSubCluster)`
   `addReservationHomeSubCluster`, will not be added repeatedly for the 
existing reservationId.
   
   I added a condition, if i=0, continue to use `addReservationHomeSubCluster`
   
   





> Improve Query Condition of FederationStateStore#getApplicationsHomeSubCluster
> -----------------------------------------------------------------------------
>
>                 Key: YARN-11290
>                 URL: https://issues.apache.org/jira/browse/YARN-11290
>             Project: Hadoop YARN
>          Issue Type: Improvement
>          Components: federation
>    Affects Versions: 3.4.0
>            Reporter: fanshilun
>            Assignee: fanshilun
>            Priority: Minor
>              Labels: pull-request-available
>         Attachments: SqlServer-StoredProc.png
>
>
> 1. Currently this interface returns the number of apps in all sub-clusters, 
> increasing the limit on the number of query apps, limited to 1000 apps.
> 2. Allows to query the App based on the specified HomeSubCluster.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org

Reply via email to