You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2017/12/20 16:24:03 UTC

mesos git commit: Fixed an agent assertion.

Repository: mesos
Updated Branches:
  refs/heads/master ee621bb36 -> 2d108e659


Fixed an agent assertion.

Initially it was valid to assert that 'checkpointResources' would
never be called for an agent with resource providers, but we have
sinced moved to an implementation where we might perform checkpointing
of agent resources (but never local resource provider resources).

This patch adjusts an assertion in the agent's 'checkpointResources'
function to that reality.

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


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/2d108e65
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/2d108e65
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/2d108e65

Branch: refs/heads/master
Commit: 2d108e659e0b1a43956274a8b6c62066fdbc823f
Parents: ee621bb
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Wed Dec 20 08:23:54 2017 -0800
Committer: Jie Yu <yu...@gmail.com>
Committed: Wed Dec 20 08:23:54 2017 -0800

----------------------------------------------------------------------
 src/slave/slave.cpp | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/2d108e65/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index 264705f..6271cfe 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -3630,14 +3630,13 @@ void Slave::checkpointResources(
   // An agent with resource providers requires an offer operation feedback
   // protocol instead of simply checkpointing results by the master. Fail hard
   // here instead of applying an incompatible message.
-  const bool hasResourceProviders = std::any_of(
-      totalResources.begin(),
-      totalResources.end(),
+  const bool checkpointingResourceProviderResources = std::any_of(
+      _checkpointedResources.begin(),
+      _checkpointedResources.end(),
       [](const Resource& resource) { return resource.has_provider_id(); });
 
-  CHECK(!hasResourceProviders)
-    << "Master protocol for offer operations is incompatible with agent with "
-       "resource providers";
+  CHECK(!checkpointingResourceProviderResources)
+    << "Resource providers must perform their own checkpointing";
 
   convertResourceFormat(&_checkpointedResources, POST_RESERVATION_REFINEMENT);