> On Вер. 6, 2016, 11:55 після полудня, Alejandro Fernandez wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java,
> >  line 332
> > <https://reviews.apache.org/r/51629/diff/3/?file=1492354#file1492354line332>
> >
> >     This query is not correct.
> >     
> >     try,
> >     select component_name from (select component_name, count(*) as num from 
> > (select component_name, current_state from hostcomponentstate group by 
> > component_name, current_state) as agg group by component_name) as result 
> > where num > 1;
> 
> Sid Wagle wrote:
>     Why is the query wrong?

Alejandro, my query search for duplicates of component - host pair. For each 
host we should have only one instance of hostcomponent. In your query you are 
using component - current_state pair, it's a different logic.


- Vitalyi


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


On Вер. 6, 2016, 10:29 після полудня, Vitalyi Brodetskyi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51629/
> -----------------------------------------------------------
> 
> (Updated Вер. 6, 2016, 10:29 після полудня)
> 
> 
> Review request for Ambari, Andrew Onischuk, Dmytro Sen, and Sid Wagle.
> 
> 
> Bugs: AMBARI-18309
>     https://issues.apache.org/jira/browse/AMBARI-18309
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Add db consistency check for hostcomponent tables, for each component we 
> should have only one state.
> 
> 
> Diffs
> -----
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java
>  f302b8b 
>   
> ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyChecker.java
>  535d74f 
>   
> ambari-server/src/test/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelperTest.java
>  4663310 
> 
> Diff: https://reviews.apache.org/r/51629/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> 
> Thanks,
> 
> Vitalyi Brodetskyi
> 
>

Reply via email to