Added comment to master logic for downgrading checkpointed resources.

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


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

Branch: refs/heads/master
Commit: ea7c9807b649f7305c20515ec60785cd08ea5f33
Parents: 09fcc7f
Author: Neil Conway <neil.con...@gmail.com>
Authored: Sat Jun 24 12:06:15 2017 -0700
Committer: Neil Conway <neil.con...@gmail.com>
Committed: Sat Jun 24 20:57:15 2017 -0700

----------------------------------------------------------------------
 src/master/master.cpp | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/ea7c9807/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 33eca0d..09c8beb 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -6389,6 +6389,14 @@ void Master::___reregisterSlave(
   message.mutable_resources()->CopyFrom(slave->checkpointedResources);
 
   if (!slave->capabilities.reservationRefinement) {
+    // If the agent is not refinement-capable, don't send it
+    // checkpointed resources that contain refined reservations. This
+    // might occur if a reservation refinement is created but never
+    // reaches the agent (e.g., due to network partition), and then
+    // the agent is downgraded before the partition heals.
+    //
+    // TODO(neilc): It would probably be better to prevent the agent
+    // from re-registering in this scenario.
     Try<Nothing> result = downgradeResources(message.mutable_resources());
     if (result.isError()) {
       LOG(WARNING) << "Not sending updated checkpointed resouces "
@@ -8870,6 +8878,14 @@ void Master::_apply(Slave* slave, const 
Offer::Operation& operation) {
   message.mutable_resources()->CopyFrom(slave->checkpointedResources);
 
   if (!slave->capabilities.reservationRefinement) {
+    // If the agent is not refinement-capable, don't send it
+    // checkpointed resources that contain refined reservations. This
+    // might occur if a reservation refinement is created but never
+    // reaches the agent (e.g., due to network partition), and then
+    // the agent is downgraded before the partition heals.
+    //
+    // TODO(neilc): It would probably be better to prevent the agent
+    // from re-registering in this scenario.
     Try<Nothing> result = downgradeResources(message.mutable_resources());
     if (result.isError()) {
       LOG(WARNING) << "Not sending updated checkpointed resouces "

Reply via email to