Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/5704#issuecomment-97167557
  
    Thanks for submitting the patch @sryza. I haven't had the time to respond 
to your comment on #5536 until recently, so let's move the discussion here. 
Echoing my concern about this approach (and the existing approach) from there:
    
    Cancel in my mind should only deal with pending requests. This behavior is 
reflected on the `YarnAllocator` side, where a cancel request from the EAM does 
not remove existing executors, but only cancels pending executor requests from 
the RM. Thus, I would think that cancel should only be a best-effort feature 
and should not affect add and remove behavior.
    
    If you look at the example I outlined in detail on #5536, the old EAM's 
cancel behavior *does* affect the add behavior. In particular, in step (4) our 
new target is 6 (which is less than what we currently have, 10) even though we 
intended to add 1 executor, so really the new target should be 11. The reason 
is because cancel and add are so intertwined that it's impossible to think 
about them independently.
    
    This patch also maintains this behavior. If an add immediately follows a 
cancel, then the add may not actually add any executors because the cancel 
exerts its influence beyond the pending executors. For instance, if after 
cancel our new target is 0, then the first few adds may use a target that is 
actually *below* the number of executors we currently have, which is 
essentially a no-op.
    
    Further note that this is not that uncommon of a case. Since we basically 
unconditionally attempt to cancel every interval, we can have a stage that just 
finished running, in which case no executors will be needed and we will request 
a target of 0. Then when a new stage comes in we will have to ramp up from the 
beginning again.
    
    **Summary.** My main point is that cancel on the EAM side should only deal 
with pending requests, because it only deals with pending requests in the 
allocator side as well. Otherwise, its influence will be felt 
disproportionately when we do try to add again.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to