You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2013/06/10 20:03:38 UTC

git commit: Added a master detector document.

Updated Branches:
  refs/heads/master a3f1c0c8b -> 23e49db26


Added a master detector document.


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

Branch: refs/heads/master
Commit: 23e49db263587579554a6f843e69678050a22800
Parents: a3f1c0c
Author: Benjamin Mahler <bm...@twitter.com>
Authored: Mon Jun 10 11:03:24 2013 -0700
Committer: Benjamin Mahler <bm...@twitter.com>
Committed: Mon Jun 10 11:03:24 2013 -0700

----------------------------------------------------------------------
 docs/Upgrades.md | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/23e49db2/docs/Upgrades.md
----------------------------------------------------------------------
diff --git a/docs/Upgrades.md b/docs/Upgrades.md
new file mode 100644
index 0000000..a8b2268
--- /dev/null
+++ b/docs/Upgrades.md
@@ -0,0 +1,35 @@
+Master Detection
+=========
+Leader election and detection in Mesos is done via ZooKeeper. See: http://zookeeper.apache.org/doc/trunk/recipes.html#sc_leaderElection for more information how ZooKeeper leader election works.
+
+Use
+---
+In order to spin up a Mesos cluster using multiple masters for fault-tolerance:
+
+  - Start the mesos-master binaries using the `--zk` flag, e.g. `--zk=zk://host1:port1/path,host2:port2/path,...`
+  - Start the mesos-slave binaries with `--master=zk://host1:port1/path,host2:port2/path,...`
+
+Semantics
+---------
+The detector is implemented in the `src/detector` folder. In particular, we watch for several ZooKeeper session events:
+
+  - Connection
+  - Reconnection
+  - Session Expiration
+  - ZNode creation, deletion, updates
+
+We also explicitly timeout our sessions, when disconnected from ZooKeeper for an amount of time, see: `ZOOKEEPER_SESSION_TIMEOUT`. This is because the ZooKeeper client libraries only notify of session expiration upon reconnection. These timeouts are of particular interest in the case of network partitions.
+
+Network Partitions
+------------------
+When a network partition occurs, if a particular component is disconnected from ZooKeeper, the Master Detector of the partitioned component will induce a timeout event. This causes the component to be notified that there is no leading master.
+
+When slaves are master-less, they ignore incoming messages from masters to ensure that we don't act on a non-leading master's decision.
+
+When masters enter a leader-less state, they commit suicide.
+
+The following semantics are enforced:
+
+  - If a slave is partitioned from the master, it will fail health-checks. The master will mark the slave as deactivated and send its tasks to LOST.
+  - Deactivated slaves may not re-register with the master, and are instructed to shut down upon any further communication after deactivation.
+  - When a slave is partitioned from ZooKeeper, it will enter a master-less state. It will ignore any master messages until a new master is elected.