Re: Review Request 51629: Add check to DB conistency checker for duplicate hostcomponentstate

2016-09-07 Thread Alejandro Fernandez

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




ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java
 (line 332)


The variable name is "GET_HOST_COMPONENT_STATE_DUPLICATES_QUERY" so I 
interpreted this as any pairs that are dups of the tuple , in 
which the state is also different.
But you're right that the component and host should only appear once.


- Alejandro Fernandez


On Sept. 6, 2016, 10:29 p.m., Vitalyi Brodetskyi wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51629/
> ---
> 
> (Updated Sept. 6, 2016, 10:29 p.m.)
> 
> 
> 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
> 
>



Re: Review Request 51629: Add check to DB conistency checker for duplicate hostcomponentstate

2016-09-07 Thread Vitalyi Brodetskyi


> On Вер. 6, 2016, 11:55 після полудня, Alejandro Fernandez wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java,
> >  line 332
> > 
> >
> > 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
> 
>



Re: Review Request 51629: Add check to DB conistency checker for duplicate hostcomponentstate

2016-09-06 Thread Sid Wagle


> On Sept. 6, 2016, 11:55 p.m., Alejandro Fernandez wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java,
> >  line 332
> > 
> >
> > 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;

Why is the query wrong?


- Sid


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


On Sept. 6, 2016, 10:29 p.m., Vitalyi Brodetskyi wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51629/
> ---
> 
> (Updated Sept. 6, 2016, 10:29 p.m.)
> 
> 
> 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
> 
>



Re: Review Request 51629: Add check to DB conistency checker for duplicate hostcomponentstate

2016-09-06 Thread Alejandro Fernandez

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




ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java
 (line 332)


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;


- Alejandro Fernandez


On Sept. 6, 2016, 10:29 p.m., Vitalyi Brodetskyi wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51629/
> ---
> 
> (Updated Sept. 6, 2016, 10:29 p.m.)
> 
> 
> 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
> 
>



Re: Review Request 51629: Add check to DB conistency checker for duplicate hostcomponentstate

2016-09-06 Thread Sid Wagle

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


Ship it!




Ship It!

- Sid Wagle


On Sept. 6, 2016, 10:29 p.m., Vitalyi Brodetskyi wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51629/
> ---
> 
> (Updated Sept. 6, 2016, 10:29 p.m.)
> 
> 
> 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
> 
>



Re: Review Request 51629: Add check to DB conistency checker for duplicate hostcomponentstate

2016-09-06 Thread Vitalyi Brodetskyi

---
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 (updated)
-

  
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



Re: Review Request 51629: Add check to DB conistency checker for duplicate hostcomponentstate

2016-09-06 Thread Alejandro Fernandez

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




ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java
 (line 328)


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;



ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java
 (line 381)


Typo, "than" instead of "then"


- Alejandro Fernandez


On Sept. 6, 2016, 12:06 p.m., Vitalyi Brodetskyi wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51629/
> ---
> 
> (Updated Sept. 6, 2016, 12:06 p.m.)
> 
> 
> 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
> 
>



Re: Review Request 51629: Add check to DB conistency checker for duplicate hostcomponentstate

2016-09-06 Thread Sid Wagle

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




ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java
 (line 332)


Although this query works, this has a dependency on host table. So what if 
the hosts table is clean and only hostcomponentstate has inconsistency?

IMO, self join would be safest bet to find discrepancy.


- Sid Wagle


On Sept. 6, 2016, 12:06 p.m., Vitalyi Brodetskyi wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51629/
> ---
> 
> (Updated Sept. 6, 2016, 12:06 p.m.)
> 
> 
> 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
> 
>



Re: Review Request 51629: Add check to DB conistency checker for duplicate hostcomponentstate

2016-09-06 Thread Vitalyi Brodetskyi


> On Вер. 5, 2016, 9:41 після полудня, Sid Wagle wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java,
> >  line 328
> > 
> >
> > This does't look right, the component needs to be on the smae host as 
> > well. Wouldn't this always return true on a multi-host cluster ?

Sorry, i thought about that but forgot to add it.


- Vitalyi


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


On Вер. 6, 2016, 12:06 після полудня, Vitalyi Brodetskyi wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51629/
> ---
> 
> (Updated Вер. 6, 2016, 12:06 після полудня)
> 
> 
> 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
> 
>



Re: Review Request 51629: Add check to DB conistency checker for duplicate hostcomponentstate

2016-09-06 Thread Vitalyi Brodetskyi

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

(Updated Вер. 6, 2016, 12:06 після полудня)


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 (updated)
-

  
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



Re: Review Request 51629: Add check to DB conistency checker for duplicate hostcomponentstate

2016-09-05 Thread Sid Wagle

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




ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java
 (line 328)


This does't look right, the component needs to be on the smae host as well. 
Wouldn't this always return true on a multi-host cluster ?


- Sid Wagle


On Sept. 5, 2016, 11:43 a.m., Vitalyi Brodetskyi wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51629/
> ---
> 
> (Updated Sept. 5, 2016, 11:43 a.m.)
> 
> 
> 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
>  36a2d99 
>   
> 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
>  a7c77e1 
> 
> Diff: https://reviews.apache.org/r/51629/diff/
> 
> 
> Testing
> ---
> 
> mvn clean test
> 
> 
> Thanks,
> 
> Vitalyi Brodetskyi
> 
>



Review Request 51629: Add check to DB conistency checker for duplicate hostcomponentstate

2016-09-05 Thread Vitalyi Brodetskyi

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

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
 36a2d99 
  
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
 a7c77e1 

Diff: https://reviews.apache.org/r/51629/diff/


Testing
---

mvn clean test


Thanks,

Vitalyi Brodetskyi