You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by an...@apache.org on 2016/10/07 01:42:59 UTC

[4/4] mesos git commit: Added `AGENT_ADDED` and `AGENT_REMOVED` master events.

Added `AGENT_ADDED` and `AGENT_REMOVED` master events.

This allows a subscriber subscribed to the v1 Operator API to
receive events when an agent is added/removed to the cluster.

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


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

Branch: refs/heads/master
Commit: 2c3bdb441f3a278f63213e8817ee9eec2226e551
Parents: 8dd9b65
Author: Zhitao Li <zh...@gmail.com>
Authored: Thu Oct 6 14:45:20 2016 -0700
Committer: Anand Mazumdar <an...@apache.org>
Committed: Thu Oct 6 18:42:44 2016 -0700

----------------------------------------------------------------------
 include/mesos/master/master.proto    | 24 ++++++++++++++++++++++++
 include/mesos/v1/master/master.proto | 24 ++++++++++++++++++++++++
 2 files changed, 48 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/2c3bdb44/include/mesos/master/master.proto
----------------------------------------------------------------------
diff --git a/include/mesos/master/master.proto b/include/mesos/master/master.proto
index 1ea79fd..d2312dc 100644
--- a/include/mesos/master/master.proto
+++ b/include/mesos/master/master.proto
@@ -441,6 +441,8 @@ message Event {
     SUBSCRIBED = 1; // See `Subscribed` below.
     TASK_ADDED = 2; // See `TaskAdded` below.
     TASK_UPDATED = 3; // See `TaskUpdated` below.
+    AGENT_ADDED = 4; // See `AgentAdded` below.
+    AGENT_REMOVED = 5; // See `AgentRemoved` below.
 
     // TODO(vinod): Fill in more events.
   }
@@ -468,9 +470,31 @@ message Event {
     required TaskState state = 5;
   }
 
+  // Forwarded by the master when an agent becomes known to it.
+  // This can happen when an agent registered for the first
+  // time, or reregistered after a disconnection or failover.
+  message AgentAdded {
+    required Response.GetAgents.Agent agent = 1;
+  }
+
+  // Forwarded by the master when an agent is removed.
+  // This can happen when an agent does not re-register
+  // within `--agent_reregister_timeout` upon a master failover,
+  // or when the agent is scheduled for maintenance.
+  //
+  // NOTE: It's possible that an agent might become
+  // active once it has been removed, i.e. if the master
+  // has gc'ed its list of known "dead" agents.
+  // See MESOS-5965 for context.
+  message AgentRemoved {
+    required SlaveID agent_id = 1;
+  }
+
   optional Type type = 1;
 
   optional Subscribed subscribed = 2;
   optional TaskAdded task_added = 3;
   optional TaskUpdated task_updated = 4;
+  optional AgentAdded agent_added = 5;
+  optional AgentRemoved agent_removed = 6;
 }

http://git-wip-us.apache.org/repos/asf/mesos/blob/2c3bdb44/include/mesos/v1/master/master.proto
----------------------------------------------------------------------
diff --git a/include/mesos/v1/master/master.proto b/include/mesos/v1/master/master.proto
index 58dc650..0dc6cca 100644
--- a/include/mesos/v1/master/master.proto
+++ b/include/mesos/v1/master/master.proto
@@ -442,6 +442,8 @@ message Event {
     SUBSCRIBED = 1; // See `Subscribed` below.
     TASK_ADDED = 2; // See `TaskAdded` below.
     TASK_UPDATED = 3; // See `TaskUpdated` below.
+    AGENT_ADDED = 4; // See `AgentAdded` below.
+    AGENT_REMOVED = 5; // See `AgentRemoved` below.
 
     // TODO(vinod): Fill in more events.
   }
@@ -469,9 +471,31 @@ message Event {
     required TaskState state = 5;
   }
 
+  // Forwarded by the master when an agent becomes known to it.
+  // This can happen when an agent registered for the first
+  // time, or reregistered after a disconnection or failover.
+  message AgentAdded {
+    required Response.GetAgents.Agent agent = 1;
+  }
+
+  // Forwarded by the master when an agent is removed.
+  // This can happen when an agent does not re-register
+  // within `--agent_reregister_timeout` upon a master failover,
+  // or when the agent is scheduled for maintenance.
+  //
+  // NOTE: It's possible that an agent might become
+  // active once it has been removed, i.e. if the master
+  // has gc'ed its list of known "dead" agents.
+  // See MESOS-5965 for context.
+  message AgentRemoved {
+    required AgentID agent_id = 1;
+  }
+
   optional Type type = 1;
 
   optional Subscribed subscribed = 2;
   optional TaskAdded task_added = 3;
   optional TaskUpdated task_updated = 4;
+  optional AgentAdded agent_added = 5;
+  optional AgentRemoved agent_removed = 6;
 }