You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bu...@apache.org on 2015/11/25 17:43:18 UTC

svn commit: r973551 - in /websites/staging/sling/trunk/content: ./ documentation/bundles/discovery-api-and-impl.html

Author: buildbot
Date: Wed Nov 25 16:43:18 2015
New Revision: 973551

Log:
Staging update by buildbot for sling

Modified:
    websites/staging/sling/trunk/content/   (props changed)
    websites/staging/sling/trunk/content/documentation/bundles/discovery-api-and-impl.html

Propchange: websites/staging/sling/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Wed Nov 25 16:43:18 2015
@@ -1 +1 @@
-1716463
+1716480

Modified: websites/staging/sling/trunk/content/documentation/bundles/discovery-api-and-impl.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/bundles/discovery-api-and-impl.html (original)
+++ websites/staging/sling/trunk/content/documentation/bundles/discovery-api-and-impl.html Wed Nov 25 16:43:18 2015
@@ -134,6 +134,7 @@ instances) and contains a simple propert
 <li><a href="#deployment-and-configuration">Deployment and configuration</a></li>
 <li><a href="#discoveryimpl-resource-based-ootb-implementation">discovery.impl: Resource-based, OOTB Implementation</a><ul>
 <li><a href="#location-in-repository">Location in Repository</a></li>
+<li><a href="#heartbeats-voting-and-intra-cluster-discovery">Heartbeats, Voting and Intra-Cluster Discovery</a></li>
 <li><a href="#topology-connectors-for-cross-cluster-discovery">Topology Connectors for Cross-Cluster Discovery</a></li>
 <li><a href="#webconsole">WebConsole</a></li>
 <li><a href="#configuration">Configuration</a></li>
@@ -248,6 +249,26 @@ that it sees the same number of instance
 </pre></div>
 
 
+<h3 id="heartbeats-voting-and-intra-cluster-discovery">Heartbeats, Voting and Intra-Cluster Discovery<a class="headerlink" href="#heartbeats-voting-and-intra-cluster-discovery" title="Permanent link">&para;</a></h3>
+<p><code>discovery.impl</code> uses the fact that all instance of a cluster are connected to the same repository as the
+basis for discovering those instances. It does so by using a heartbeat and voting mechanism:</p>
+<ul>
+<li>each instance periodically stores a 'heartbeat' into the repository in a well-known location.
+This is done by setting a corresponding <code>lastHeartbeat</code> property to the current timestamp</li>
+<li>a 'heartbeat' that has not yet timed out is considered a signal that the instance is alive</li>
+<li>as soon as a 'heartbeat' is timed out, the assumption is that the corresponding instance is dead/shutdown</li>
+</ul>
+<p>To avoid having each instance make it's own, perhaps differing conclusions as to which instance/heartbeat is dead or not,
+there is an explicit, unanimous voting mechanism that agrees upon a list of alive instances. This list of alive
+instances is called cluster view.<br />
+<em> as soon as any instance notices a change in the list of active instances, it is free to calculate a new
+such list and start a voting in the cluster - each voting carries a unique votingId
+</em> since any instance can do this, you can have concurrent creation of new votings
+<em> each instance has one 'yes' vote - and if there are multiple concurrent votings the lowest one wins
+</em> when a voting receives a 'yes' from all instances that it enlists it is considered as 'winning'
+and is promoted to be the new, valid view from now on.
+* a promoted view is stored in <code>/var/discovery/impl/establishedView</code> and any change therein is
+passed on in a TopologyEvent to all registered listeners.</p>
 <h3 id="topology-connectors-for-cross-cluster-discovery">Topology Connectors for Cross-Cluster Discovery<a class="headerlink" href="#topology-connectors-for-cross-cluster-discovery" title="Permanent link">&para;</a></h3>
 <p>From a discovery API's point of view a cluster consists of all instances that are connected to the same repository.
 The above described built-in mechanism of storing a lastHeartbeat property into the (shared) repository, of voting on changes
@@ -321,7 +342,7 @@ They use the same interval and timeout a
 </li>
 </ul>
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
-        Rev. 1716463 by stefanegli on Wed, 25 Nov 2015 16:21:08 +0000
+        Rev. 1716480 by stefanegli on Wed, 25 Nov 2015 16:43:10 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project