> On Feb. 17, 2017, 5:10 a.m., Sebastian Toader wrote:
> > ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql, line 75
> > <https://reviews.apache.org/r/56766/diff/1/?file=1637981#file1637981line75>
> >
> >     Do we need the ```selected``` field at all? This information could be 
> > derived from ```selected_timestamp``` field. The record with the largest 
> > type in ```selected_timestamp``` for a config type is the selected one. Or 
> > this would add too much complexity and performance hit to the queries like 
> > ```ClusterConfigEntity.findEnabledConfigsByTypes``` ?

Technically, we could probably get away with it and infer what is selected. 
However, I think that makes the queries much more complex. Additionally, it 
becomes harder to determine what's selected by looking at the database when 
diagnosing issues. There are also queries which rely on `selected = 1` which 
would need to change to a correlated query with an aggregate function like MAX()


- Jonathan


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


On Feb. 16, 2017, 4:12 p.m., Jonathan Hurley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56766/
> -----------------------------------------------------------
> 
> (Updated Feb. 16, 2017, 4:12 p.m.)
> 
> 
> Review request for Ambari, Nate Cole, Robert Levas, Sebastian Toader, and Sid 
> Wagle.
> 
> 
> Bugs: AMBARI-20054
>     https://issues.apache.org/jira/browse/AMBARI-20054
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Please see the Epic (https://issues.apache.org/jira/browse/AMBARI-20053) for 
> a full description. Additionally, supporting work (such as Ambari upgrade) is 
> tracked in that epic via other Jiras (like AMBARI-20055)
> 
> This review is for AMBARI-20054, which tracks the work needed to remove the 
> `clusterconfigmapping` table and transfer its responsibility into the 
> `clusterconfig` table.
> 
> 
> Diffs
> -----
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java
>  926ec65 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/DatabaseChecker.java
>  d35fc1a 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ClusterDAO.java 
> b727c72 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigEntity.java
>  d14e60e 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigMappingEntity.java
>  5748dc9 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigMappingEntityPK.java
>  e5ba5af 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterEntity.java
>  2e0a15d 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceConfigEntity.java
>  dae7ef8 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/DesiredConfig.java 
> 80d05f7 
>   ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java 
> 713c189 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
>  db4aa21 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java 
> 328fe22 
>   ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql f007b53 
>   ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql f6cb896 
>   ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql 19253e8 
>   ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql b13a9e3 
>   ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql cf2954a 
>   ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 16c269a 
>   
> ambari-server/src/test/java/org/apache/ambari/server/orm/dao/ServiceConfigDAOTest.java
>  a0732ab 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/DesiredConfigTest.java
>  09aaa92 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
>  6cdfbad 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClustersTest.java
>  5b54af4 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/host/HostTest.java 
> d418a80 
> 
> Diff: https://reviews.apache.org/r/56766/diff/
> 
> 
> Testing
> -------
> 
> - Cluster deployment from scratch
> - New configurations created and reverted to
> - Stack upgrade, downgrade, upgrade/finalize
> - Configuration group creation
> 
> Tests run: 4918, Failures: 0, Errors: 0, Skipped: 39
> 
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Total time: 17:24 min
> [INFO] Finished at: 2017-02-16T15:02:06-05:00
> [INFO] Final Memory: 59M/661M
> [INFO] 
> ------------------------------------------------------------------------
> 
> 
> Thanks,
> 
> Jonathan Hurley
> 
>

Reply via email to