rdtr opened a new pull request, #60142:
URL: https://github.com/apache/spark/pull/60142

   ### What changes were proposed in this pull request?
   
   `YarnAllocator.handleNodesInDecommissioningState` now also handles node 
reports in the `RUNNING` state and removes the host from 
`decommissioningNodesCache`. Before this change, hosts were only ever added to 
the cache and were removed only by LRU eviction after 200 entries.
   
   ### Why are the changes needed?
   
   When a DECOMMISSIONING node is recommissioned, the RM reports it to the AM 
in `AllocateResponse.getUpdatedNodes` as `RUNNING` (YARN-10538). 
`YarnAllocator` ignored that report, so the host stayed in 
`decommissioningNodesCache`.
   
   If YARN then allocates new containers on that host and the host is 
decommissioned again, the second `DECOMMISSIONING` report is dropped by the 
stale cache entry. `DecommissionExecutorsOnHost` is never sent to the driver, 
and the executors started after the recommission are not gracefully 
decommissioned before the node goes away.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, a bug fix. With `spark.decommission.enabled=true` on YARN, executors on 
a node that is decommissioned, recommissioned and decommissioned again are now 
decommissioned the second time as well. Previously only the first 
decommissioning of a host was handled.
   
   ### How was this patch tested?
   
   Added a test to `YarnAllocatorSuite` that replays DECOMMISSIONING, RUNNING 
and DECOMMISSIONING reports for the same host and verifies that 
`DecommissionExecutorsOnHost` is sent twice. Without the fix it fails with 
`Wanted 2 times ... But was 1 time`.
   
   ```
   build/mvn -pl resource-managers/yarn -Pyarn test -Dtest=none 
-DwildcardSuites=org.apache.spark.deploy.yarn.YarnAllocatorSuite
   ```
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 5.5)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to