You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ch...@apache.org on 2019/05/01 21:16:35 UTC

[mesos] branch 1.5.x updated (791ac63 -> 13b2888)

This is an automated email from the ASF dual-hosted git repository.

chhsiao pushed a change to branch 1.5.x
in repository https://gitbox.apache.org/repos/asf/mesos.git.


    from 791ac63  Added MESOS-9695 to the 1.5.4 CHANGELOG.
     new 6c0d92b  Do not implicitly decline speculatively converted resources.
     new 13b2888  Added MESOS-9616 to the 1.5.4 CHANGELOG.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 CHANGELOG             |  1 +
 src/master/master.cpp | 37 +++++++++++++++++++++++++++++++------
 2 files changed, 32 insertions(+), 6 deletions(-)


[mesos] 01/02: Do not implicitly decline speculatively converted resources.

Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

chhsiao pushed a commit to branch 1.5.x
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 6c0d92b5826205481be133e8f054f184b2cbb4cc
Author: Chun-Hung Hsiao <ch...@mesosphere.io>
AuthorDate: Mon Apr 22 15:46:36 2019 -0700

    Do not implicitly decline speculatively converted resources.
    
    Currently if a framework accepts an offer with a `RESERVE` operation
    without a task consuming the reserved resources, the resources will be
    implicitly declined. This is counter to what one would expect (that only
    the remaining resources in the offer will be declined):
    
      Offer `cpus:10` -> `ACCEPT` with `RESERVE cpus(role):1`
                         *Actual* implicit decline: `cpus:9;cpus(role):1`
                         *Expected* implicit decline: `cpus:9`
    
    The same issue is present with other transformational operations (i.e.,
    `UNRESERVE`, `CREATE` and `DESTROY`).
    
    This patch fixes this issue by only implicitly declining the "remaining"
    untransformed resources, computed as follows:
    
      Offered = `cpus:10`
      Remaining = `cpus:9;cpus(role):1`
      Implicitly declined = remaining - (remaining - offered)
                          = `cpus:9;cpus(role):1` - `cpus:(role):1`
                          = `cpus:9`
    
    Review: https://reviews.apache.org/r/70132
---
 src/master/master.cpp | 37 +++++++++++++++++++++++++++++++------
 1 file changed, 31 insertions(+), 6 deletions(-)

diff --git a/src/master/master.cpp b/src/master/master.cpp
index 995ff55..42f88b6 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -5456,13 +5456,38 @@ void Master::_accept(
         conversions);
   }
 
-  if (!_offeredResources.empty()) {
-    // Tell the allocator about the unused (e.g., refused) resources.
+  // We now need to compute the amounts of remaining (1) speculatively converted
+  // resources to recover without a filter and (2) resources that are implicitly
+  // declined with the filter:
+  //
+  // Speculatively converted resources
+  //   = (offered resources).apply(speculative operations)
+  //       - resources consumed by non-speculative operations
+  //       - offered resources not consumed by any operation
+  //   = `_offeredResources` - offered resources not consumed by any operation
+  //   = `_offeredResources` - offered resources
+  //
+  // (The last equality holds because resource subtraction yields no negatives.)
+  //
+  // Implicitly declined resources
+  //   = (offered resources).apply(speculative operations)
+  //       - resources consumed by non-speculative operations
+  //       - speculatively converted resources
+  //   = `_offeredResources` - speculatively converted resources
+  Resources speculativelyConverted = _offeredResources - offeredResources;
+  Resources implicitlyDeclined = _offeredResources - speculativelyConverted;
+
+  // Tell the allocator about the net speculatively converted resources. These
+  // resources should not be implicitly declined.
+  if (!speculativelyConverted.empty()) {
     allocator->recoverResources(
-        frameworkId,
-        slaveId,
-        _offeredResources,
-        accept.filters());
+        frameworkId, slaveId, speculativelyConverted, None());
+  }
+
+  // Tell the allocator about the implicitly declined resources.
+  if (!implicitlyDeclined.empty()) {
+    allocator->recoverResources(
+        frameworkId, slaveId, implicitlyDeclined, accept.filters());
   }
 }
 


[mesos] 02/02: Added MESOS-9616 to the 1.5.4 CHANGELOG.

Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

chhsiao pushed a commit to branch 1.5.x
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 13b2888ead47cc7efbdd20c267089e673546a380
Author: Chun-Hung Hsiao <ch...@mesosphere.io>
AuthorDate: Wed May 1 13:41:32 2019 -0700

    Added MESOS-9616 to the 1.5.4 CHANGELOG.
---
 CHANGELOG | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG b/CHANGELOG
index fd85213..c38fa85 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -4,6 +4,7 @@ Release Notes - Mesos - Version 1.5.4 (WIP)
 
 ** Bug
   * [MESOS-9529] - `/proc` should be remounted even if a nested container set `share_pid_namespace` to true.
+  * [MESOS-9616] - `Filters.refuse_seconds` declines resources not in offers.
   * [MESOS-9619] - Mesos Master Crashes with Launch Group when using Port Resources
   * [MESOS-9695] - Remove the duplicate pid check in Docker containerizer
   * [MESOS-9707] - Calling link::lo() may cause runtime error