You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by zh...@apache.org on 2018/05/09 00:07:03 UTC
[2/2] mesos git commit: Refreshed checkpointed SlaveInfo if
`--reconfiguration_policy==any`.
Refreshed checkpointed SlaveInfo if `--reconfiguration_policy==any`.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/d4ad8f1d
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/d4ad8f1d
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/d4ad8f1d
Branch: refs/heads/reconfiguration_policy_any
Commit: d4ad8f1d5a1ded50f86ee44482c59045df016957
Parents: c62fe46
Author: Zhitao Li <zh...@gmail.com>
Authored: Tue May 8 17:01:32 2018 -0700
Committer: Zhitao Li <zh...@gmail.com>
Committed: Tue May 8 17:06:42 2018 -0700
----------------------------------------------------------------------
src/slave/slave.cpp | 14 ++++++++++++++
1 file changed, 14 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/d4ad8f1d/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index c008a17..5dfd041 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -1600,6 +1600,20 @@ void Slave::reregistered(
switch (state) {
case DISCONNECTED:
LOG(INFO) << "Re-registered with master " << master.get();
+
+ // Agent is running a different `SlaveInfo` from recovered. This was
+ // permitted by `flags.reconfiguration_policy` but we want to correct the
+ // checkpointed info.
+ if (requiredMasterCapabilities.agentUpdate &&
+ flags.reconfiguration_policy == "any") {
+ // Checkpoint reconfigured slave info.
+ const string path = paths::getSlaveInfoPath(metaDir, slaveId);
+
+ LOG(INFO) << "Checkpointing reconfigured SlaveInfo to '" << path << "'";
+
+ CHECK_SOME(state::checkpoint(path, info));
+ }
+
state = RUNNING;
taskStatusUpdateManager->resume(); // Resume status updates.