You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2016/10/19 23:33:59 UTC
[09/10] mesos git commit: Renamed a function for clarity.
Renamed a function for clarity.
`Master::reconcile(Framework*, const scheduler::Call::Reconcile&)` and
`Master::reconcile(Slave*, const vector<ExecutorInfo>&, const
vector<Task>& tasks)` are only loosely related. Per discussion on the
development list, using overloading to distinguish these two functions
is confusing. Hence, rename the latter to `reconcileKnownSlave`.
Review: https://reviews.apache.org/r/52719/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/da2ca0f1
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/da2ca0f1
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/da2ca0f1
Branch: refs/heads/master
Commit: da2ca0f17d9ac9a0248edd18ed2cc7c774e985d4
Parents: 97bd957
Author: Neil Conway <ne...@gmail.com>
Authored: Wed Oct 19 16:32:21 2016 -0700
Committer: Vinod Kone <vi...@gmail.com>
Committed: Wed Oct 19 16:32:21 2016 -0700
----------------------------------------------------------------------
src/master/master.cpp | 12 ++++--------
src/master/master.hpp | 7 ++++---
2 files changed, 8 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/da2ca0f1/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index bf6bb1a..0cdb45f 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -5318,10 +5318,9 @@ void Master::reregisterSlave(
// Update slave's version after re-registering successfully.
slave->version = version;
- // Reconcile tasks between master and the slave.
- // NOTE: This sends the re-registered message, including tasks
- // that need to be reconciled by the slave.
- reconcile(slave, executorInfos, tasks);
+ // Reconcile tasks between master and slave, and send the
+ // `SlaveReregisteredMessage`.
+ reconcileKnownSlave(slave, executorInfos, tasks);
// If this is a disconnected slave, add it back to the allocator.
// This is done after reconciliation to ensure the allocator's
@@ -6767,10 +6766,7 @@ void Master::authenticationTimeout(Future<Option<string>> future)
}
-// NOTE: This function is only called when the slave re-registers
-// with a master that already knows about it (i.e., not a failed
-// over master).
-void Master::reconcile(
+void Master::reconcileKnownSlave(
Slave* slave,
const vector<ExecutorInfo>& executors,
const vector<Task>& tasks)
http://git-wip-us.apache.org/repos/asf/mesos/blob/da2ca0f1/src/master/master.hpp
----------------------------------------------------------------------
diff --git a/src/master/master.hpp b/src/master/master.hpp
index 263ceb4..6d2db9d 100644
--- a/src/master/master.hpp
+++ b/src/master/master.hpp
@@ -640,9 +640,10 @@ protected:
Framework* framework,
const std::vector<TaskStatus>& statuses);
- // Handles a known re-registering slave by reconciling the master's
- // view of the slave's tasks and executors.
- void reconcile(
+ // When a slave that is known to the master re-registers, we need to
+ // reconcile the master's view of the slave's tasks and executors.
+ // This function also sends the `ReregisterSlaveMessage`.
+ void reconcileKnownSlave(
Slave* slave,
const std::vector<ExecutorInfo>& executors,
const std::vector<Task>& tasks);