> On Jan. 25, 2014, 9:03 p.m., Sumit Mohanty wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
> >  
> > * I think we should throw error on an attempt to set PassiveState.IMPLIED. 
> > Currently, the call will not throw an error if the existing state is 
> > PassiveState.IMPLIED. Essentially, trying to set anything but 
> > ACTIVE/PASSIVE is an error.
> > 
> > What happens on upgrade - do we fill in PASSIVE for all or leave the column 
> > empty? When a Service/Host/HostComponent is created (for a new cluster) do 
> > we set the initial value to be empty or PassiveState.PASSIVE?
> > 
> > Should values of passive_state be PASSIVE, IMPLIED_PASSIVE, ACTIVE? I was 
> > wondering if IMPLIED can be understood as IMPLIED_ACTIVE.
> > 
> > We may also need to block CUSTOM_COMMANDs and ACTIONS when target resource 
> > is PASSIVE. Feel free to open a JIRA against me as I need to make changes 
> > related DECOMMISSION and setting passive state when being decommissioned.
> > 
> > ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java
> >  
> > 
> > * Not sure, why we need a passivity-map here? AFAIK, a host can only belong 
> > to a single cluster.
> > 
> >  
> > 
> >

* This is done in AmbariManagementControllerImpl for host_components only.  
ServiceResourceProvider and HostResourceProvider makes that check for those 
targets.
* We default to ACTIVE for upgrades and null columns.
* I was figuring IMPLIED meant the same as PASSIVE, it's just not set directly. 
 You can't have an IMPLIED Service or Host, only a HC can be that.
* Agreed
* I consulted with Mahadev on this - it's conceivable that one host CAN be 
assigned to more than one cluster, even when we say it's unsupported (for now). 
 We agreed that setting a Host to PASSIVE should be specific to a cluster.  So, 
you can't call to /api/v1/hosts/h1 to set passive mode, it must be via 
/api/v1/clusters/c1/hosts/h1.


- Nate


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/17334/#review32791
-----------------------------------------------------------


On Jan. 24, 2014, 5:42 p.m., Nate Cole wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/17334/
> -----------------------------------------------------------
> 
> (Updated Jan. 24, 2014, 5:42 p.m.)
> 
> 
> Review request for Ambari, Sumit Mohanty and Sid Wagle.
> 
> 
> Bugs: AMBARI-4419
>     https://issues.apache.org/jira/browse/AMBARI-4419
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Add ability set a new state on Service, Host, HostComponent - a Passive State.
> Passive State is used to maintain control of a unit in Ambari, but skip 
> operations that include an item. Examples:
> If a Service is Passive, a call to restart all Services should skip a passive 
> one.
> However, said Service can be acted upon, if it is a direct target.
> A restart of a Service will ignore Hosts that are Passive.
> A restart of a Service will ignore HostComponents that are Passive.
> Rolling restarts do not affect items that are marked Passive
> 
> 
> Diffs
> -----
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
>  26a02a4 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
>  a9b6364 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/HostRequest.java
>  12dd0f6 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/HostResponse.java
>  616a1ea 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentHostRequest.java
>  6b673b0 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentHostResponse.java
>  a776ac2 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceRequest.java
>  03ea6a9 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceResponse.java
>  82b61e8 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
>  dbc81a2 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
>  1759826 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
>  6387255 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentDesiredStateEntity.java
>  7f04c51 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostStateEntity.java
>  35b9a4d 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceDesiredStateEntity.java
>  1af9406 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Host.java 
> 832de26 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/PassiveState.java 
> PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Service.java 
> 5fe2d71 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java
>  4ce632a 
>   ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java 
> 0e978ea 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java 
> f8bf36e 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
>  d9135c0 
>   ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 4f6068e 
>   ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql b2c255e 
>   ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql f15ccd1 
>   ambari-server/src/main/resources/Ambari-DDL-Postgres-REMOTE-CREATE.sql 
> 0586ba3 
>   ambari-server/src/main/resources/properties.json 1e555c2 
>   ambari-server/src/main/resources/upgrade/ddl/Ambari-DDL-MySQL-UPGRADE.sql 
> 702a8d4 
>   ambari-server/src/main/resources/upgrade/ddl/Ambari-DDL-Oracle-UPGRADE.sql 
> 4edd1a2 
>   
> ambari-server/src/main/resources/upgrade/ddl/Ambari-DDL-Postgres-UPGRADE-1.3.0.sql
>  ae2e02f 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
>  bc2039e 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java
>  9bf0c94 
>   ambari-server/src/test/java/org/apache/ambari/server/state/ServiceTest.java 
> f9658fa 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/host/HostTest.java 
> 272a448 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostTest.java
>  da3e3e1 
> 
> Diff: https://reviews.apache.org/r/17334/diff/
> 
> 
> Testing
> -------
> 
> Change tests:
> org.apache.ambari.server.controller.AmbariManagementControllerTest
> org.apache.ambari.server.controller.internal.HostResourceProviderTest
> org.apache.ambari.server.state.ServiceTest
> org.apache.ambari.server.state.host.HostTest
> org.apache.ambari.server.state.svccomphost.ServiceComponentHostTest
> 
> All tests
> ---------
> Results :
> 
> Tests run: 1287, Failures: 0, Errors: 0, Skipped: 7
> 
> [INFO]
> 
> 
> Thanks,
> 
> Nate Cole
> 
>

Reply via email to