Repository: mesos Updated Branches: refs/heads/master f036eb611 -> aaef8563f
Fixed handling of resource versions in agent oversubscribed updates. Agents can use 'UpdateSlaveMessage' to send updates on their oversubscribed resources, their resource provider state, or both. We previously assumed that 'UpdateSlaveMessage' from a resource provider-capable agent would always contain the most recent resource version of the agent even thought the field is marked 'optional'. This patch simplifies the handling in the master to not assert a set resource version for 'UpdateSlaveMessage' for resource provider-capable agents. Instead we explicitly and unconditionally check whether the field is set and handle only set values. Review: https://reviews.apache.org/r/64648/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/66dbf993 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/66dbf993 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/66dbf993 Branch: refs/heads/master Commit: 66dbf9932142b8444af19d9993a64529c7d4a891 Parents: f036eb6 Author: Benjamin Bannier <[email protected]> Authored: Fri Dec 15 17:54:39 2017 +0100 Committer: Benjamin Bannier <[email protected]> Committed: Fri Dec 15 17:54:39 2017 +0100 ---------------------------------------------------------------------- src/master/master.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/66dbf993/src/master/master.cpp ---------------------------------------------------------------------- diff --git a/src/master/master.cpp b/src/master/master.cpp index e082da8..321af8b 100644 --- a/src/master/master.cpp +++ b/src/master/master.cpp @@ -7294,11 +7294,7 @@ void Master::updateSlave(UpdateSlaveMessage&& message) slave->totalResources != newSlaveResources || message.has_resource_providers(); - // Agents which can support resource providers always update the - // master on their resource versions uuid via `UpdateSlaveMessage`. - if (slave->capabilities.resourceProvider) { - CHECK(message.has_resource_version_uuid()); - + if (message.has_resource_version_uuid()) { hashmap<Option<ResourceProviderID>, id::UUID> resourceVersions; const Try<id::UUID> slaveResourceVersion =
