Repository: mesos Updated Branches: refs/heads/master aaef8563f -> 699a5d226
Fixed handling of resource provider updates without resources. On master failover the master might learn about a resource provider without resources. This patch relaxes an assertion in the master permitting such scenarios. Review: https://reviews.apache.org/r/64600/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/699a5d22 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/699a5d22 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/699a5d22 Branch: refs/heads/master Commit: 699a5d2263f417df56dcad70cebe28ad284919d1 Parents: aaef856 Author: Benjamin Bannier <[email protected]> Authored: Fri Dec 15 18:17:57 2017 +0100 Committer: Benjamin Bannier <[email protected]> Committed: Fri Dec 15 18:19:22 2017 +0100 ---------------------------------------------------------------------- src/master/master.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/699a5d22/src/master/master.cpp ---------------------------------------------------------------------- diff --git a/src/master/master.cpp b/src/master/master.cpp index 321af8b..cf8a22b 100644 --- a/src/master/master.cpp +++ b/src/master/master.cpp @@ -7601,7 +7601,9 @@ void Master::updateSlave(UpdateSlaveMessage&& message) // If this is a not previously seen resource provider we had a master // failover. Add the resources and operations to our state. CHECK_SOME(provider.newTotal); - CHECK(!slave->totalResources.contains(provider.newTotal.get())); + CHECK( + provider.newTotal->empty() || + !slave->totalResources.contains(provider.newTotal.get())); CHECK_SOME(provider.info); slave->resourceProviders.insert({providerId.get(), provider.info.get()});
