Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin: Transaction-based speculative reserve and logic unification #936

Merged
merged 2 commits into from
Jun 16, 2024

Commits on Jun 16, 2024

  1. plugin: Add transactions for speculative operations (#936)

    This commit adds 'pkg/util/xact' with usage in scheduler plugin such
    that all places that previously implemented checks for "can this pod fit
    on that node" are now done by speculatively reserving the pod, checking
    if it left the node over-full, and then deciding whether to accept it.
    
    This is unified through a new method speculativeReserve(). Internally,
    speculativeReserve() calls a new method on resourceTransitioner, which
    makes follow-up work easier.
    sharnoff committed Jun 16, 2024
    Configuration menu
    Copy the full SHA
    3c250e4 View commit details
    Browse the repository at this point in the history
  2. plugin/trans: Unify handleReserve+handleRequested (#936)

    This introduces a new method on resourceTransitioner[T],
    handleRequestedGeneric(), which implements a superset of the
    functionality needed by both handleReserve and handleRequested.
    
    The two latter methods now internally "just" call the new method, albeit
    with different parameterizations.
    
    ---
    
    Other changes:
    
    - The new method has a notion of "forced approval minimum", which sets
      the minimum value it must approve, even if the node would be
      over-budget.
      - This is used to retain the infallible behavior of handleReserve.
      - This is *also* used to move the lastPermit logic into
        handleRequested.
    - Because of the new forced approval minimum, handleLastPermit is no
      longer needed.
    
    ---
    
    In general, the motivation behind this change is to reduce the number of
    distinct implementations of resource logic, so there's fewer changes
    involved in implementing overcommit.
    sharnoff committed Jun 16, 2024
    Configuration menu
    Copy the full SHA
    148a85d View commit details
    Browse the repository at this point in the history