Yuan Luo created YARN-11992:
-------------------------------

             Summary: Multi-node allocation discards an earlier reservation 
after later nodes are skipped
                 Key: YARN-11992
                 URL: https://issues.apache.org/jira/browse/YARN-11992
             Project: Hadoop YARN
          Issue Type: Bug
          Components: capacity scheduler, multi-node-placement
            Reporter: Yuan Luo


h3. Problem

When multi-node placement is enabled, {{RegularContainerAllocator.allocate()}} 
continues to inspect other candidate nodes after one node returns {{RESERVED}}. 
If a later candidate is skipped, that later result overwrites the earlier 
reservation. The method then returns the skip result and the valid reservation 
is lost.

The reservation must also be completed against the node that produced it. Using 
the last visited candidate would associate the reserved container with the 
wrong node.

h3. Reproduction

# Use a candidate set containing at least two nodes.
# The first node can fit the request in total capacity but lacks currently 
available resources, so allocation returns {{RESERVED}}.
# A later node cannot satisfy the same request and returns a skip result.

Actual result: the allocator returns the later skip result and does not create 
the earlier reservation.

Expected result: after candidate traversal is exhausted, the allocator should 
create the most recent valid reservation on the node that produced it. If a 
later allocation attempt reaches {{doAllocation()}}, its result must be 
returned directly instead of falling back to a stale reservation.

h3. Proposed fix

Track both the most recent reservation result and its corresponding node. If 
traversal finishes without an allocation, complete that reservation on the 
saved node. Return the result of an allocation attempt directly so a failed 
allocation cannot incorrectly restore an older reservation.

h3. Tests

Add focused coverage for:
* reservation followed by a skipped candidate;
* multiple reservations, where the latest reservation and its node win;
* a failed allocation after an earlier reservation, which must not fall back to 
the stale reservation.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to