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

Andrei Sekretenko commented on MESOS-1452:
------------------------------------------

{code}
commit 927b012e96abeebbb02c293698be1ef43867e15f
Author: Andrei Sekretenko <asekrete...@mesosphere.io>
Date:   Fri Sep 6 14:15:54 2019 -0700

    Replaced removeOffer + recoverResources pairs with specialized helpers.
    
    This patch adds helper methods `Master::rescindOffer()` /
    `Master::discardOffer()` that recover offer's resources in the allocator
    and remove the offer, and replaces paired calls of `removeOffer()` +
    `allocator->recoverResources()` with these helpers.
    
    Review: https://reviews.apache.org/r/71436/

{code}
{code}
commit c20469edb25348e70bf1647a57694e6dff8041c4
Author: Andrei Sekretenko <asekrete...@mesosphere.io>
Date:   Fri Sep 6 14:15:48 2019 -0700

    Moved setting expectation for recoverResources() to a proper place.
    
    Currently, when accepting offers for a slave already removed from
    the master, Master::_accept() dispatches `recoverResources()`
    unconditionally (with empty resources if, due to framework/slave removal
    the offers were already rescinded and their resources recovered).
    
    The depending patch removes this redundant recovery of empty resources,
    thus exposing a race in some of `MasterAuthorizationTest.*` tests
    between `FUTURE_DISPATCH(_, &MesosAllocatorProcess::recoverResources)`
    and the dispatch which performs the actual resource recovery.
    
    This patch is fixing these tests to wait for the first dispatch of
    `recoverResources()`.
    
    Review: https://reviews.apache.org/r/71435/

{code}

> Improve Master::removeOffer to avoid further resource accounting bugs.
> ----------------------------------------------------------------------
>
>                 Key: MESOS-1452
>                 URL: https://issues.apache.org/jira/browse/MESOS-1452
>             Project: Mesos
>          Issue Type: Improvement
>            Reporter: Benjamin Mahler
>            Assignee: Andrei Sekretenko
>            Priority: Major
>
> Per comments on this review: https://reviews.apache.org/r/21750/
> We've had numerous bugs around resource accounting in the master due to the 
> trickiness of removing offers in the Master code.
> There are a few ways to improve this:
> 1. Add multiple offer methods to differentiate semantics:
> {code}
> useOffer(offerId);
> rescindOffer(offerId);
> discardOffer(offerId);
> {code}
> 2. Add an enum to removeOffer to differentiate removal semantics:
> {code}
> removeOffer(offerId, USE);
> removeOffer(offerId, RESCIND);
> removeOffer(offerId, DISCARD);
> {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to