[jira] [Commented] (MESOS-1452) Improve Master::removeOffer to avoid further resource accounting bugs.

2019-09-06 Thread Meng Zhu (Jira)


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

Meng Zhu commented on MESOS-1452:
-

{noformat}
commit a8050cafaa5465bd74a2ced1c37bb6b64c735445
Author: Andrei Sekretenko 
Date:   Fri Sep 6 14:15:28 2019 -0700

Separated handling offer validation failure from handling success.

This patch refactors the loop through offer IDs in `Master::accept()`
into two simpler loops: one loop for the offer validation failure case,
another for the case of validation success, thus bringing removal of
offers and recovering their resources close together.

This is a prerequisite for implementing `rescindOffer()`/
`declineOffer()` in the dependent patch.

Review: https://reviews.apache.org/r/71433/

commit 7eb21c41ed255184988298e29644bf7f310c3374
Author: Andrei Sekretenko 
Date:   Fri Sep 6 14:15:38 2019 -0700

Moved `removeOffers()` from `Master::accept()` into `Master::_accept()`.

This patch moves offer removal on accept into the deferred continuation
that follows authorization (if offers pass validation in `accept()`).

Incrementing the `offers_accepted` metric is also moved to `_accept()`.

This is a prerequisite for implementing `rescindOffer()` /
`declineOffer()` / in the dependent patch.

Review: https://reviews.apache.org/r/71434/

Author: Andrei Sekretenko 
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/
{noformat}


> 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
>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)


[jira] [Assigned] (MESOS-1452) Improve Master::removeOffer to avoid further resource accounting bugs.

2019-09-06 Thread Meng Zhu (Jira)


 [ 
https://issues.apache.org/jira/browse/MESOS-1452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Meng Zhu reassigned MESOS-1452:
---

Assignee: Andrei Sekretenko

> 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)


[jira] [Commented] (MESOS-9914) Refactor `MesosTest::StartSlave` in favour of builder style interface

2019-09-06 Thread Andrei Budnik (Jira)


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

Andrei Budnik commented on MESOS-9914:
--

 
{code:java}
commit 6c2a94ca0eca90e6d3517e4400f4529ddce0b84c
Author: Andrei Budnik abud...@apache.org
Date:   Mon Sep 2 17:15:52 2019 +0200
Added `SlaveOptions` for wrapping all parameters of `StartSlave`.

This patch introduces a `SlaveOptions` struct which holds optional
parameters accepted by `cluster::Slave::create`. Added an overload
of `StartSlave` that accepts `SlaveOptions`. It's a preferred way of
creating and starting an instance of `cluster::Slave` in tests, since
underlying `cluster::Slave::create` accepts a long list of optional
arguments, which might be extended in the future.

Review: https://reviews.apache.org/r/71424
{code}
 

> Refactor `MesosTest::StartSlave` in favour of builder style interface
> -
>
> Key: MESOS-9914
> URL: https://issues.apache.org/jira/browse/MESOS-9914
> Project: Mesos
>  Issue Type: Improvement
>  Components: test
>Reporter: Andrei Budnik
>Assignee: Andrei Budnik
>Priority: Major
>
> Every overload of `MesosTest::StartSlave` method depend on 
> `cluster::Slave::create` method, which accepts several arguments. In fact, 
> each overload of `MesosTest::StartSlave` accepts a subset of combination of 
> arguments that `cluster::Slave::create` accept. Given that the latter accepts 
> 11 arguments at the moment, and there are already 13 overloads of the 
> `MesosTest::StartSlave`, introducing a builder-style interface is very 
> desirable. It'd allow adding more arguments to the `cluster::Slave::create` 
> without the necessity to update all existing overloads. It would be a local 
> change as it won't affect existing tests.
> See [this 
> comment|https://github.com/apache/mesos/blob/00bb0b6d6abe7700a5adab0bdaf7e91767a2db19/src/tests/mesos.hpp#L160-L177].



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