Details
-
Task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
Mesosphere Sprint 16, Mesosphere Sprint 17, Mesosphere Sprint 18
-
8
Description
Offers are currently sent from master/allocator to framework via ResourceOffersMessage's. InverseOffers, which are roughly equivalent to negative Offers, can be sent in the same package.
In src/messages/messages.proto
message ResourceOffersMessage {
repeated Offer offers = 1;
repeated string pids = 2;
// New field with InverseOffers
repeated InverseOffer inverseOffers = 3;
}
Sent InverseOffers can be tracked in the master's local state:
i.e. In src/master/master.hpp:
struct Slave { ... // Existing fields. // Active InverseOffers on this slave. // Similar pattern to the "offers" field hashset<InverseOffer*> inverseOffers; }
One actor (master or allocator) should populate the new InverseOffers field.
- In master (src/master/master.cpp)
- Master::offer is where the ResourceOffersMessage and Offer object is constructed.
- The same method could also check for maintenance and send InverseOffers.
- In the allocator (src/master/allocator/mesos/hierarchical.hpp)
- HierarchicalAllocatorProcess::allocate is where slave resources are aggregated an sent off to the frameworks.
- InverseOffers (i.e. negative resources) allocation could be calculated in this method.
- A change to Master::offer (i.e. the "offerCallback") may be necessary to account for the negative resources.
Possible test(s):
- InverseOfferTest
- Start master, slave, framework.
- Accept resource offer, start task.
- Set maintenance schedule to the future.
- Check that InverseOffer(s) are sent to the framework.
- Decline InverseOffer.
- Check that more InverseOffer(s) are sent.
- Accept InverseOffer.
- Check that more InverseOffer(s) are sent.
Attachments
Issue Links
- blocks
-
MESOS-3044 Slaves are not deactivated upon reaching a maintenance window
- Resolved
- is blocked by
-
MESOS-2061 Add InverseOffer protobuf message.
- Resolved
-
MESOS-2062 Add InverseOffer to Event/Call API.
- Resolved
- Is contained by
-
MESOS-2076 Implement maintenance primitives in the Master.
- Resolved