Author: stevel
Date: Thu Mar 19 16:48:39 2015
New Revision: 1667813

URL: http://svn.apache.org/r1667813
Log:
SLIDER-824 Update rolehistory.md with new placement details

Modified:
    incubator/slider/site/trunk/content/design/rolehistory.md

Modified: incubator/slider/site/trunk/content/design/rolehistory.md
URL: 
http://svn.apache.org/viewvc/incubator/slider/site/trunk/content/design/rolehistory.md?rev=1667813&r1=1667812&r2=1667813&view=diff
==============================================================================
--- incubator/slider/site/trunk/content/design/rolehistory.md (original)
+++ incubator/slider/site/trunk/content/design/rolehistory.md Thu Mar 19 
16:48:39 2015
@@ -15,28 +15,79 @@
    limitations under the License.
 -->
 
-# Apache Slider Role History: how Slider brings back nodes in the same location
+# Apache Slider Placement: how Slider brings back nodes in the same location
 
-### Last updated  2013-12-06
+### Last updated  2015-03-19
 
-* This document uses the pre-slider terminology of role/cluster and not
-component and application instance *
 
+## Changes
 
-## Outstanding issues
 
-1. Can we use the history to implement anti-affinity: for any role with this 
flag,
-use our knowledge of the cluster to ask for all nodes that aren't in use 
already
 
-1. How to add blacklisting here? We are tracking failures and startup failures
-per node (not persisted), but not using this in role placement requests yet.
+### Slider 0.80-incubating
+
+A major rework of placement has taken place, [Über-JIRA : placement phase 
2](https://issues.apache.org/jira/browse/SLIDER-611)
+
+1. Slider manages the process of relaxing a request from a specific host to 
"anywhere in the cluster".
+1. Each role/component type may have a configurable timeout for `escalation` 
to begin.
+1. Slider periodically checks (every 30s by default) to see if there are 
outstanding requests
+that have reached their escalation timeout and yet have not been satisfied.
+1. Such requests are cancelled and "relaxed" requests re-issued.
+1. Labels are always respected; even relaxed requests use any labels specified 
in `resources.json`
+1. If a node is considered unreliable (as per-the slider 0.70 changes), it is 
not used in the initial
+request. 
+
+#### `strict` placement
+
+Again, "strict placement" has a different policy: once a component has been 
deployed on a node,
+one component request will be made against that node, even if it is considered 
unreliable. No
+relaxation of the request will ever take place.
+
+#### `none` placement
+
+If the placement policy is "none", the request will always be relaxed.
+While tracking of recent failure counts takes place, it is not used in 
placement requests.
+
+#### `anti-affine` placement
+
+There's still no explicit support for this in YARN or slider. As noted above, 
Slider does
+try to spread placement when rebuilding an application, but otherwise it 
accepts which
+hosts YARN allocates containers on.
+
+
+
+
+### Slider 0.70-incubating
+
+The Slider AM tracks the recent failure count of each role on each (known) 
YARN node; when
+the failure count of a role is above a role-specific threshold, no more 
explicit requests are
+made for that host. Exception: "strict placement" component deployments are 
always requsted
+against the node irrespective of their history.
+ 
+This failure count is reset on a regular schedule to avoid a past history of 
contaminating
+Slider's placement history indefinitely. The fact that a node was unreliable 
two weeks ago should
+not mean that it should be blacklisted this week. 
+
+Note that this failure history is not persisted; it is lost on AM 
start/restart.
+
+### Slider 0.60-incubating
+
+1. Slider supports `strict placement` in which a request is when made for a 
previously
+used node and never used again.
+1. Different component types can be assigned specific labels to be deployed 
upon. This allows
+cluster administrators to partition the YARN cluster up into different 
functions, with
+specific Slider Application instances only requesting components on 
differently labelled sets of
+nodes. As such, it offers significant control of component placement, without 
actually dedicating
+hardware to specific applications. Note that the HDFS filesystem is still 
shared across the cluster,
+so IO from other in-cluster applications will impinge on each other.
+
 
 ## Introduction
 
 Slider needs to bring up instances of a given role on the machine(s) on which
-they last ran -it should remember after shrinking or freezing a cluster  which
-servers were last used for a role -and use this (persisted) data to select
-clusters next time
+they last ran. It must remember after shrinking or freezing an Application 
Instance  which
+servers were last used for a role. It must then try to use this (persisted) 
data to select
+hosts next time
 
 It does this in the basis that the role instances prefer node-local
 access to data previously persisted to HDFS. This is precisely the case
@@ -45,7 +96,7 @@ without using the TCP stack. The HBase m
 assigned to specific Region Servers, and when HBase is restarted its master
 tries to reassign the same tables back to Region Servers on the same machine.
 
-For this to work in a dynamic cluster, Slider needs to bring up Region Servers
+For this to work in a dynamic environment, Slider needs to bring up Region 
Servers
 on the previously used hosts, so that the HBase Master can re-assign the same
 tables.
 
@@ -55,71 +106,76 @@ the key requirement.
 
 ### Terminology
 
-* **Role Instance** : a single instance of a role.
-* **Node** : A server in the YARN Physical (or potentially virtual) Cluster of 
servers.
-* **Slider Cluster**: The set of role instances deployed by Slider so as to 
- create a single aggregate application.
+* **Node** : A server in the YARN Physical (or potentially virtual) cluster of 
servers.
+* **Application Instance**: A deployment of a distributed application as 
created and
+managed by Slider. 
+* **Component** a non-unique part of the distributed application; that is, an 
application
+is defined as containing different components; zero or more **instances** of 
each component
+may be declared as required in this Application Instance.
+Internally the term `role` is used in classes and variables; this is the 
original term used,
+and so retained across much of the code base.
+* **Component Instance** : a single instance of a component. 
 * **Slider AM**: The Application Master of Slider: the program deployed by 
YARN to
-manage its Slider Cluster.
+manage its Application Instance.
 * **RM** YARN Resource Manager
 
 ### Assumptions
 
 Here are some assumptions in Slider's design
 
-1. Instances of a specific role should preferably be deployed onto different
+1. Instances of a specific component should preferably be deployed onto 
different
 servers. This enables Slider to only remember the set of server nodes onto
 which instances were created, rather than more complex facts such as "two 
Region
 Servers were previously running on Node #17. On restart Slider can simply 
request
 one instance of a Region Server on a specific node, leaving the other instance
 to be arbitrarily deployed by YARN. This strategy should help reduce the 
*affinity*
-in the role deployment, so increase their resilience to failure.
+in the component deployment, so increase their resilience to failure.
 
 1. There is no need to make sophisticated choices on which nodes to request
 re-assignment -such as recording the amount of data persisted by a previous
 instance and prioritizing nodes based on such data. More succinctly 'the
 only priority needed when asking for nodes is *ask for the most recently used*.
 
-1. Different roles are independent: it is not an issue if a role of one type
+1. Different roles are independent: it is not an issue if a component of one 
type
  (example, an Accumulo Monitor and an Accumulo Tablet Server) are on the same
  host. This assumption allows Slider to only worry about affinity issues within
- a specific role, rather than across all roles.
+ a specific component, rather than across all roles.
  
-1. After a cluster has been started, the rate of change of the cluster is
-low: both node failures and cluster flexing happen at the rate of every few
+1. After an Application Instance has been started, the rate of change of the 
application is
+low: both node failures and flexing happen at the rate of every few
 hours, rather than every few seconds. This allows Slider to avoid needing
 data structures and layout persistence code designed for regular and repeated 
changes.
 
 1. Instance placement is best-effort: if the previous placement cannot be 
satisfied,
-the application will still perform adequately with role instances deployed
+the application will still perform adequately with component instances deployed
 onto new servers. More specifically, if a previous server is unavailable
-for hosting a role instance due to lack of capacity or availability, Slider
+for hosting a component instance due to lack of capacity or availability, 
Slider
 will not decrement the number of instances to deploy: instead it will rely
 on YARN to locate a new node -ideally on the same rack.
 
-1. If two instances of the same role do get assigned to the same server, it
+1. If two instances of the same component do get assigned to the same server, 
it
 is not a failure condition. (This may be problematic for some roles 
--we may need a role-by-role policy here, so that master nodes can be 
anti-affine)
+-we may need a component-by-component policy here, so that master nodes can be 
anti-affine)
 [specifically, >1 HBase master mode will not come up on the same host]
 
-1. If a role instance fails on a specific node, asking for a container on
+1. If a component instance fails on a specific node, asking for a container on
 that same node for the replacement instance is a valid recovery strategy.
 This contains assumptions about failure modes -some randomness here may
 be a valid tactic, especially for roles that do not care about locality.
 
 1. Tracking failure statistics of nodes may be a feature to add in future;
-designing the Role History datastructures to enable future collection
+designing the RoleHistory datastructures to enable future collection
 of rolling statistics on recent failures would be a first step to this 
 
-### The Role History
+### The RoleHistory Datastructure
 
-The `RoleHistory` is a datastructure which models the role assignment, and
+The `RoleHistory` is a datastructure which models the component assignment, and
 can persist it to and restore it from the (shared) filesystem.
 
-* For each role, there is a list of cluster nodes which have supported this 
role
+* For each component, there is a list of YARN cluster nodes which have 
supported this component
 used in the past.
 
-* This history is used when selecting a node for a role.
+* This history is used when selecting a node for a component.
 
 * This history remembers when nodes were allocated. These are re-requested
 when starting an application instance again, and when re-requesting 
@@ -133,40 +189,40 @@ to a previous size during flex operation
 with YARN. This ensures that the same node is not requested more than once
 due to outstanding requests.
 
-* It does not retain a complete history of the role -and does not need to.
-All it needs to retain is the recent history for every node onto which a role
+* It does not retain a complete history of the component -and does not need to.
+All it needs to retain is the recent history for every node onto which a 
component
 instance has been deployed. Specifically, the last allocation or release
 operation on a node is all that needs to be persisted.
 
 * On AM startup, all nodes in the history are considered candidates, even 
those nodes currently marked
 as active -as they were from the previous instance.
 
-* On AM restart, nodes in the role history marked as active have to be 
considered
-still active -the YARN RM will have to provide the full list of which are not.
+* On AM restart, nodes in the history marked as active have to be considered
+still active —the YARN RM will have to provide the full list of which are 
not.
 
-* During cluster flexing, nodes marked as released -and for which there is no
+* During flexing, nodes marked as released -and for which there is no
 outstanding request - are considered candidates for requesting new instances.
 
-* When choosing a candidate node for hosting a role instance, it from the head
-of the time-ordered list of nodes that last ran an instance of that role
+* When choosing a candidate node for hosting a component instance, it from the 
head
+of the time-ordered list of nodes that last ran an instance of that component
 
 ### Persistence
 
-The state of the role is persisted to HDFS on changes -but not on cluster
+The state of the component is persisted to HDFS on changes —but not on 
Application Instance
 termination.
 
-1. When nodes are allocated, the Role History is marked as dirty
-1. When container release callbacks are received, the Role History is marked 
as dirty
-1. When nodes are requested or a release request made, the Role History is 
*not*
+1. When nodes are allocated, the RoleHistory is marked as dirty
+1. When container release callbacks are received, the RoleHistory is marked as 
dirty
+1. When nodes are requested or a release request made, the RoleHistory is *not*
  marked as dirty. This information is not relevant on AM restart.
 
 As at startup, a large number of allocations may arrive in a short period of 
time,
-the Role History may be updated very rapidly -yet as the containers are
+the RoleHistory may be updated very rapidly -yet as the containers are
 only recently activated, it is not likely that an immediately restarted Slider
-cluster would gain by re-requesting containers on them -their historical
+Application Instance would gain by re-requesting containers on them -their 
historical
 value is more important than their immediate past.
 
-Accordingly, the role history may be persisted to HDFS asynchronously, with
+Accordingly, the RoleHistory may be persisted to HDFS asynchronously, with
 the dirty bit triggering an flushing of the state to HDFS. The datastructure
 will still need to be synchronized for cross thread access, but the 
 sync operation will not be a major deadlock, compared to saving the file on 
every
@@ -186,7 +242,7 @@ with the data saved in JSON or compresse
 instances on this node; there is no blacklisting. As a central blacklist
 for YARN has been proposed, it is hoped that this issue will be addressed 
centrally,
 without Slider having to remember which nodes are unreliable *for that 
particular
-Slider cluster*.
+Application Instance*.
 
 **Anti-affinity**: If multiple role instances are assigned to the same node,
 Slider has to choose on restart or flexing whether to ask for multiple
@@ -203,14 +259,14 @@ node use and picking the heaviest used,
 This may be possible, but we'd need evidence that the problem existed before
 trying to address it.
 
-# The NodeMap: the core of the Role History
+# The NodeMap
 
-The core data structure, the `NodeMap` is a map of every known node in the 
cluster, tracking
+A core data structure, the `NodeMap`, is a map of every known node in the YARN 
cluster, tracking
 how many containers are allocated to specific roles in it, and, when there
 are no active instances, when it was last used. This history is used to
 choose where to request new containers. Because of the asynchronous
-allocation and release of containers, the Role History also needs to track
-outstanding release requests --and, more critically, outstanding allocation
+allocation and release of containers, the History also needs to track
+outstanding release requests —and, more critically, outstanding allocation
 requests. If Slider has already requested a container for a specific role
 on a host, then asking for another container of that role would break
 anti-affinity requirements. Note that not tracking outstanding requests would
@@ -232,7 +288,7 @@ let YARN choose.
 * Handles the multi-container on one node problem
 * By storing details about every role, cross-role decisions could be possible
 * Simple counters can track the state of pending add/release requests
-* Scales well to a rapidly flexing cluster
+* Scales well to a rapidly flexing Application Instance
 * Simple to work with and persist
 * Easy to view and debug
 * Would support cross-role collection of node failures in future
@@ -248,7 +304,7 @@ of recently explicitly released nodes ca
 * Need to track outstanding requests against nodes, so that if a request
 was satisfied on a different node, the original node's request count is
  decremented, *not that of the node actually allocated*. 
-* In a virtual cluster, may fill with node entries that are no longer in the 
cluster.
+* In a virtual YARN cluster, may fill with node entries that are no longer in 
the cluster.
 Slider should query the RM (or topology scripts?) to determine if nodes are 
still
 parts of the YARN cluster. 
 
@@ -276,7 +332,7 @@ This is the aggregate data structure tha
 
 ### NodeInstance
 
-Every node in the cluster is modeled as an ragged array of `NodeEntry` 
instances, indexed
+Every node in the YARN cluster is modeled as an ragged array of `NodeEntry` 
instances, indexed
 by role index -
 
     NodeEntry[roles]
@@ -335,7 +391,7 @@ to index the specific role in a containe
 has been offered in a container allocation message, and which role has
 been released on a release event.
 
-The Role History needs to track outstanding requests, so that
+The History needs to track outstanding requests, so that
 when an allocation comes in, it can be mapped back to the original request.
 Simply looking up the nodes on the provided container and decrementing
 its request counter is not going to work -the container may be allocated
@@ -346,7 +402,7 @@ on a different node from that requested.
 rolling integer -Slider will assume that after 2^24 requests per role, it can 
be rolled,
 -though as we will be retaining a list of outstanding requests, a clash should 
not occur.
 The main requirement  is: not have > 2^24 outstanding requests for instances 
of a specific role,
-which places an upper bound on the size of a Slider cluster.
+which places an upper bound on the size of the Application Instance.
 
 The splitting and merging will be implemented in a ContainerPriority class,
 for uniform access.
@@ -404,7 +460,7 @@ list of all Nodes which are available fo
 using a comparator that places the most recently released node ahead of older
 nodes.
 
-This list is not persisted -when a Slider Cluster is stopped it is moot, and 
when
+This list is not persisted —when the Application Instance is stopped it is 
moot, and when
 an AM is restarted this structure will be rebuilt.
 
 1. When a node is needed for a new request, this list is consulted first.
@@ -415,15 +471,15 @@ of the list for that role.
 
 If the list is empty during a container request operation, it means
 that the Role History does not know of any nodes
-in the cluster that have hosted instances of that role and which are not
+in the YARN cluster that have hosted instances of that role and which are not
 in use. There are then two possible strategies to select a role
 
-1. Ask for an instance anywhere in the cluster (policy in Slider 0.5)
+1. Ask for an instance anywhere in the YARN cluster (policy in Slider 0.5)
 1. Search the node map to identify other nodes which are (now) known about,
-but which are not hosting instances of a specific role -this can be used
+but which are not hosting instances of a specific role —this can be used
 as the target for the next resource request.
 
-Strategy #1 is simpler; Strategy #2 *may* decrease the affinity in the cluster,
+Strategy #1 is simpler; Strategy #2 *may* decrease the affinity of component 
placement,
 as the AM will be explicitly requesting an instance on a node which it knows
 is not running an instance of that role.
 
@@ -434,7 +490,7 @@ Should a node whose container just faile
 top of the stack, ready for the next request? 
 
 If the container failed due to an unexpected crash in the application, asking
-for that container back *is the absolute right strategy* -it will bring
+for that container back *is the absolute right strategy* —it will bring
 back a new role instance on that machine. 
 
 If the container failed because the node is now offline, the container request 
@@ -451,12 +507,12 @@ Persistent Role History file not found;
 
 ### Restart
 
-When starting a cluster, the Role History should be loaded. 
+When starting an Application Instance, the Role History should be loaded. 
 
 If the history is missing *or cannot be loaded for any reason*,
 Slider must revert to the bootstrap actions.
 
-If found, the Role History will contain Slider's view of the Slider Cluster's
+If found, the Role History will contain Slider's view of the Application 
Instance's
 state at the time the history was saved, explicitly recording the last-used
 time of all nodes no longer hosting a role's container. By noting which roles
 were actually being served, it implicitly notes which nodes have a `last_used`
@@ -466,10 +522,10 @@ saved must have more recent data than th
 
 When rebuilding the data structures, the fact that nodes were active at
 save time must be converted into the data that indicates that the nodes
-were at least in use *at the time the data was saved*. The state of the cluster
-after the last save is unknown.
+were at least in use *at the time the data was saved*.
+The state of the Application Instance after the last save is unknown.
 
-1: Role History loaded; Failure => Bootstrap.
+1: History loaded; Failure => Bootstrap.
 2: Future: if role list enum != current enum, remapping could take place. 
Until then: fail.
 3: Mark all nodes as active at save time to that of the
 
@@ -516,30 +572,22 @@ from the list of available nodes
        nodeEntry.last_used = now
        availableNodes[role].remove(nodeId)
 
-There's no need to resort the available node list -all that has happened
+There's no need to resort the available node list —all that has happened
 is that some entries have been removed
 
-
-**Issue**: what if requests come in for a `(role, requestID)` for
-the previous instance of the AM? Could we just always set the initial
-requestId counter to a random number and hope the collision rate is very, very 
-low (2^24 * #(outstanding_requests)). If YARN-1041 ensures that
-a restarted AM does not receive outstanding requests, this issue goes away.
-
-
 ### Teardown
 
 1. If dirty, save role history to its file.
 1. Issue release requests
-1. Maybe update data structures on responses, but do not mark Role History
+1. Maybe update data structures on responses, but do not mark RoleHistory
 as dirty or flush it to disk.
 
 This strategy is designed to eliminate the expectation that there will ever
-be a clean shutdown -and so that the startup-time code should expect
-the Role History to have been written during shutdown. Instead the code
+be a clean shutdown —and so that the startup-time code should expect
+the RoleHistory data to have been written during shutdown. Instead the code
 should assume that the history was saved to disk at some point during the life
-of the Slider Cluster -ideally after the most recent change, and that the 
information
-in it is only an approximate about what the previous state of the cluster was.
+of the Application Instance —ideally after the most recent change, and that 
the information
+in it is only an approximate about what the previous state of the Application 
Instance was.
 
 ### Flex: Requesting a container in role `role`
 
@@ -556,7 +604,7 @@ in it is only an approximate about what
       
 
 There is a bias here towards previous nodes, even if the number of nodes
-in the cluster has changed. This is why a node is picked where the number
+in the Application Instance has changed. This is why a node is picked where 
the number
 of `active-releasing == 0 and requested == 0`, rather than where it is simply 
the lowest
 value of `active + requested - releasing`: if there is no node in the nodemap 
that
 is not running an instance of that role, it is left to the RM to decide where
@@ -565,11 +613,11 @@ the role instance should be instantiated
 This bias towards previously used nodes also means that (lax) requests
 will be made of nodes that are currently unavailable either because they
 are offline or simply overloaded with other work. In such circumstances,
-the node will have an active count of zero -so the search will find these
-nodes and request them -even though the requests cannot be satisfied.
+the node will have an active count of zero —so the search will find these
+nodes and request them —even though the requests cannot be satisfied.
 As a result, the request will be downgraded to a rack-local or cluster-wide,
-request -an acceptable degradation on a cluster where all the other entries
-in the nodemap have instances of that specific node -but not when there are
+request —an acceptable degradation on an Application Instance where all the 
other entries
+in the nodemap have instances of that specific node —but not when there are
 empty nodes. 
 
 
@@ -579,7 +627,7 @@ empty nodes.
 iterate through the values. This would prevent the same unsatisfiable
 node from being requested first.
 
-1. Keep track of requests, perhaps through a last-requested counter -and use
+1. Keep track of requests, perhaps through a last-requested counter —and use
 this in the selection process. This would radically complicate the selection
 algorithm, and would not even distinguish "node recently released that was
 also the last requested" from "node that has not recently satisfied requests
@@ -599,7 +647,7 @@ But there are consequences:
 **Performance**:
 
 Using the history to pick a recent node may increase selection times on a
-large cluster, as for every instance needed, a scan of all nodes in the
+large Application Instance, as for every instance needed, a scan of all nodes 
in the
 nodemap is required (unless there is some clever bulk assignment list being 
built
 up), or a sorted version of the nodemap is maintained, with a node placed
 at the front of this list whenever its is updated.
@@ -607,7 +655,7 @@ at the front of this list whenever its i
 **Startup-time problems**
 
 There is also the risk that while starting an applicatin instance, the 
`rolehistory.saved`
-flag may be updated while the cluster flex is in progress, so making the saved
+flag may be updated while the flex is in progress, so making the saved
 nodes appear out of date. Perhaps the list of recently released nodes could
 be rebuilt at startup time.
 
@@ -621,7 +669,7 @@ from the last-used fields in the node en
 
 This is the callback received when containers have been allocated.
 Due to (apparently) race conditions, the AM may receive duplicate
-container allocations -Slider already has to recognize this and 
+container allocations —Slider already has to recognize this and 
 currently simply discards any surplus.
 
 If the AM tracks outstanding requests made for specific hosts, it
@@ -681,7 +729,7 @@ other sync problem.
 
 1. The node selected for the original request has its request for a role 
instance
 decremented, so that it may be viewed as available again. The node is also
-re-inserted into the AvailableNodes list -not at its head, but at its position
+re-inserted into the AvailableNodes list —not at its head, but at its 
position
 in the total ordering of the list.
  
 ### NMClientAsync Callback:  onContainerStarted()
@@ -699,14 +747,14 @@ adjusted to indicate it has one more liv
 
 
 The AM uses this as a signal to remove the container from the list
-of starting containers -the count of starting containers for the relevant
+of starting containers —the count of starting containers for the relevant
 NodeEntry is decremented. If the node is now available for instances of this
 container, it is returned to the queue of available nodes.
 
 
-### Flex: Releasing a  role instance from the cluster
+### Flex: Releasing a Component instance from the Application Instance
 
-Simple strategy: find a node with at least one active container
+Simple strategy: find a node with at least one active container of that type
 
     select a node N in nodemap where for NodeEntry[roleId]: active > 
releasing; 
     nodeentry = node.get(roleId)
@@ -777,7 +825,7 @@ has completed although it wasn't on the
       reviewRequestAndReleaseNodes()
 
 By calling `reviewRequestAndReleaseNodes()` the AM triggers
-a re-evaluation of how many instances of each node a cluster has, and how many
+a re-evaluation of how many instances of each node an Application Instance 
has, and how many
 it needs. If a container has failed and that freed up all role instances
 on that node, it will have been inserted at the front of the `availableNodes` 
list.
 As a result, it is highly likely that a new container will be requested on 
@@ -792,11 +840,11 @@ Notes made while implementing the design
 
 `OutstandingRequestTracker` should also track requests made with
 no target node; this makes seeing what is going on easier. `ARMClientImpl`
-is doing something similar, on a priority-by-priority basis -if many
+is doing something similar, on a priority-by-priority basis —if many
 requests are made, each with their own priority, that base class's hash tables
 may get overloaded. (it assumes a limited set of priorities)
 
-Access to the role history datastructures was restricted to avoid
+Access to the RoleHistory datastructures was restricted to avoid
 synchronization problems. Protected access is permitted so that a
 test subclass can examine (and change?) the internals.
 
@@ -806,7 +854,7 @@ a node that has been allocated but is no
 
 We can't reliably map from a request to a response. Does that matter?
 If we issue a request for a host and it comes in on a different port, do we
-care? Yes -but only because we are trying to track nodes which have requests
+care? Yes —but only because we are trying to track nodes which have requests
 outstanding so as not to issue new ones. But if we just pop the entry
 off the available list, that becomes moot.
 
@@ -819,7 +867,7 @@ node on them was requested but not satis
 Other issues: should we place nodes on the available list as soon as all the 
entries
 have been released?  I.e. Before YARN has replied
 
-RoleStats were removed -left in app state. Although the rolestats would
+RoleStats were removed —left in app state. Although the rolestats would
 belong here, leaving them where they were reduced the amount of change
 in the `AppState` class, so risk of something breaking.
 
@@ -831,16 +879,16 @@ against file://; so mini tests with >1 N
 `NodeInstance getOrCreateNodeInstance(Container container) '
 will always return the same (now shared) `NodeInstance`.
 
-## Releasing Containers when shrinking a cluster
+## Releasing Containers when shrinking an Application Instance
 
 When identifying instances to release in a bulk downscale operation, the full
 list of targets must be identified together. This is not just to eliminate
 multiple scans of the data structures, but because the containers are not
-released until the queued list of actions are executed -the nodes' 
release-in-progress
+released until the queued list of actions are executed —the nodes' 
release-in-progress
 counters will not be incremented until after all the targets have been 
identified.
 
 It also needs to handle the scenario where there are many role instances on a
-single server -it should prioritize those. 
+single server —it should prioritize those. 
 
 
 The NodeMap/NodeInstance/NodeEntry structure is adequate for identifying nodes,
@@ -864,26 +912,26 @@ role should be dropped from the list.
 This can happen when an instance was allocated on a different node from
 that requested.
 
-### Finding a node when a role has instances in the cluster but nothing
-known to be available
+### Finding a node when a component has some live instances and no available 
hosts known to
+Slider.
 
 One condition found during testing is the following: 
 
-1. A role has one or more instances running in the cluster
+1. A role has one or more instances running in the YARN cluster
 1. A role has no entries in its available list: there is no history of the 
 role ever being on nodes other than which is currently in use.
 1. A new instance is requested.
 
 In this situation, the `findNodeForNewInstance` method returns null: there
 is no recommended location for placement. However, this is untrue: all
-nodes in the cluster `other` than those in use are the recommended nodes. 
+nodes in the YARN cluster `other` than those in use are the recommended nodes. 
 
-It would be possible to build up a list of all known nodes in the cluster that
+It would be possible to build up a list of all known nodes in the YARN cluster 
that
 are not running this role and use that in the request, effectively telling the
 AM to pick one of the idle nodes. By not doing so, we increase the probability
 that another instance of the same role will be allocated on a node in use,
 a probability which (were there capacity on these nodes and placement random), 
be
-`1/(clustersize-roleinstances)`. The smaller the cluster and the bigger the
+`1/(clustersize-roleinstances)`. The smaller the YARN cluster and the bigger 
the
 application, the higher the risk.
 
 This could be revisited, if YARN does not support anti-affinity between new
@@ -917,12 +965,12 @@ if one or more container requests cannot
 the set of outstanding requests will be retained, so all these hosts in the
 will be considered unavailable for new location-specific requests.
 This may imply that new requests that could be explicity placed will now only
-be randomly placed -however, it is moot on the basis that if there are 
outstanding
+be randomly placed —however, it is moot on the basis that if there are 
outstanding
 container requests it means the RM cannot grant resources: new requests at the
 same priority (i.e. same Slider Role ID) will not be granted either.
 
 The only scenario where this would be different is if the resource requirements
-of instances of the target role were decreated during a cluster flex such that
+of instances of the target role were decreated during a flex such that
 the placement could now be satisfied on the target host. This is not considered
 a significant problem.
 
@@ -931,7 +979,7 @@ a significant problem.
 The initial implementation uses the JSON-formatted Avro format; while 
significantly
 less efficient than a binary format, it is human-readable
 
-Here are sequence of entries from a test run on a single node cluster; running 
1 HBase Master
+Here are sequence of entries from a test run on a single node YARN cluster; 
running 1 HBase Master
 and two region servers.
 
 Initial save; the instance of Role 1 (HBase master) is live, Role 2 (RS) is 
not.
@@ -952,9 +1000,9 @@ Another entry is saved -presumably the s
     
{"entry":{"org.apache.hoya.avro.NodeEntryRecord":{"host":"192.168.1.85","role":1,"active":true,"last_used":0}}}
     
{"entry":{"org.apache.hoya.avro.NodeEntryRecord":{"host":"192.168.1.85","role":2,"active":true,"last_used":0}}}
 
-At this point the cluster was stopped and started.
+At this point the Application Instance was stopped and started.
 
-When the cluster is restarted, every node that was active for a role at the 
time the file was saved `1384183476028`
+When the Application Instance is restarted, every node that was active for a 
role at the time the file was saved `1384183476028`
 is given a last_used timestamp of that time. 
 
 When the history is next saved, the master has come back onto the (single) 
node,
@@ -977,7 +1025,7 @@ And here, another region server has star
     
{"entry":{"org.apache.hoya.avro.NodeEntryRecord":{"host":"192.168.1.85","role":1,"active":true,"last_used":1384183476028}}}
     
{"entry":{"org.apache.hoya.avro.NodeEntryRecord":{"host":"192.168.1.85","role":2,"active":true,"last_used":1384183476028}}}
 
-The `last_used` timestamps will not be changed until the cluster is shrunk or 
restarted, as the `active` flag being set
+The `last_used` timestamps will not be changed until the Application Instance 
is shrunk or restarted, as the `active` flag being set
 implies that the server is running both roles at the save time of 
`1384183512217`.
 
 ## Resolved issues


Reply via email to