| 10317 | |
| 10318 | |
| 10319 | void Master::_failoverFramework(Framework* framework) |
| 10320 | { |
| 10321 | // Discard the framework's offers, if they weren't removed before. |
| 10322 | foreach (Offer* offer, utils::copy(framework->offers)) { |
| 10323 | discardOffer(offer); |
| 10324 | } |
| 10325 | |
| 10326 | // Also remove the inverse offers. |
| 10327 | foreach (InverseOffer* inverseOffer, utils::copy(framework->inverseOffers)) { |
| 10328 | allocator->updateInverseOffer( |
| 10329 | inverseOffer->slave_id(), |
| 10330 | inverseOffer->framework_id(), |
| 10331 | UnavailableResources{ |
| 10332 | inverseOffer->resources(), |
| 10333 | inverseOffer->unavailability()}, |
| 10334 | None()); |
| 10335 | |
| 10336 | removeInverseOffer(inverseOffer); |
| 10337 | } |
| 10338 | |
| 10339 | CHECK(!framework->recovered()); |
| 10340 | |
| 10341 | if (framework->activate()) { |
| 10342 | // The framework was inactive and needs to be activated in the allocator. |
| 10343 | // |
| 10344 | // NOTE: We do this after recovering resources (above) so that |
| 10345 | // the allocator has the correct view of the framework's share. |
| 10346 | allocator->activateFramework(framework->id()); |
| 10347 | } |
| 10348 | |
| 10349 | // The scheduler driver safely ignores any duplicate registration |
| 10350 | // messages, so we don't need to compare the old and new pids here. |
| 10351 | FrameworkRegisteredMessage message; |
| 10352 | message.mutable_framework_id()->MergeFrom(framework->id()); |
| 10353 | message.mutable_master_info()->MergeFrom(info_); |
| 10354 | framework->send(message); |
| 10355 | } |
| 10356 | |
| 10357 | |
| 10358 | void Master::teardown(Framework* framework) |
nothing calls this directly
no test coverage detected