Re: Review Request 52155: ambari server upgrade ambari to 2.1.1 duplicate key error

2016-12-02 Thread Jonathan Hurley

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



This has been pushed to trunk and branch-2.5 - please close the review.

- Jonathan Hurley


On Nov. 21, 2016, 2:52 a.m., wang yaoxin wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52155/
> ---
> 
> (Updated Nov. 21, 2016, 2:52 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Oliver Szabo, Robert Nettleton, 
> and Sebastian Toader.
> 
> 
> Bugs: AMBARI-18441
> https://issues.apache.org/jira/browse/AMBARI-18441
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> My first upgrade test failed due to my environment issue. Since in real 
> production environment this failure would  occur again.
> 
> ambari upgrade to 2.1.1 and later version, if the first time failed , excute 
> ambari-server upgrade again will error duplicate key value violates unique 
> constraint "pk_hostcomponentstate".
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
>  db13612 
> 
> Diff: https://reviews.apache.org/r/52155/diff/
> 
> 
> Testing
> ---
> 
> the unit test is UpgradeCatalog211Test.java: Process finished with exit code 
> 0.
> done !
> 
> 
> File Attachments
> 
> 
> AMBARI-18441-02.patch
>   
> https://reviews.apache.org/media/uploaded/files/2016/11/16/4c6f3d15-96cc-4c22-babe-b45b103a8c30__AMBARI-18441-02.patch
> 
> 
> Thanks,
> 
> wang yaoxin
> 
>



Re: Review Request 52155: ambari server upgrade ambari to 2.1.1 duplicate key error

2016-12-01 Thread Jonathan Hurley

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


Ship it!




Ship It!

- Jonathan Hurley


On Nov. 21, 2016, 2:52 a.m., wang yaoxin wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52155/
> ---
> 
> (Updated Nov. 21, 2016, 2:52 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Oliver Szabo, Robert Nettleton, 
> and Sebastian Toader.
> 
> 
> Bugs: AMBARI-18441
> https://issues.apache.org/jira/browse/AMBARI-18441
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> My first upgrade test failed due to my environment issue. Since in real 
> production environment this failure would  occur again.
> 
> ambari upgrade to 2.1.1 and later version, if the first time failed , excute 
> ambari-server upgrade again will error duplicate key value violates unique 
> constraint "pk_hostcomponentstate".
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
>  db13612 
> 
> Diff: https://reviews.apache.org/r/52155/diff/
> 
> 
> Testing
> ---
> 
> the unit test is UpgradeCatalog211Test.java: Process finished with exit code 
> 0.
> done !
> 
> 
> File Attachments
> 
> 
> AMBARI-18441-02.patch
>   
> https://reviews.apache.org/media/uploaded/files/2016/11/16/4c6f3d15-96cc-4c22-babe-b45b103a8c30__AMBARI-18441-02.patch
> 
> 
> Thanks,
> 
> wang yaoxin
> 
>



Re: Review Request 52155: ambari server upgrade ambari to 2.1.1 duplicate key error

2016-11-21 Thread Alejandro Fernandez

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


Ship it!




Ship It!

- Alejandro Fernandez


On Nov. 21, 2016, 7:52 a.m., wang yaoxin wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52155/
> ---
> 
> (Updated Nov. 21, 2016, 7:52 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Oliver Szabo, Robert Nettleton, 
> and Sebastian Toader.
> 
> 
> Bugs: AMBARI-18441
> https://issues.apache.org/jira/browse/AMBARI-18441
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> My first upgrade test failed due to my environment issue. Since in real 
> production environment this failure would  occur again.
> 
> ambari upgrade to 2.1.1 and later version, if the first time failed , excute 
> ambari-server upgrade again will error duplicate key value violates unique 
> constraint "pk_hostcomponentstate".
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
>  db13612 
> 
> Diff: https://reviews.apache.org/r/52155/diff/
> 
> 
> Testing
> ---
> 
> the unit test is UpgradeCatalog211Test.java: Process finished with exit code 
> 0.
> done !
> 
> 
> File Attachments
> 
> 
> AMBARI-18441-02.patch
>   
> https://reviews.apache.org/media/uploaded/files/2016/11/16/4c6f3d15-96cc-4c22-babe-b45b103a8c30__AMBARI-18441-02.patch
> 
> 
> Thanks,
> 
> wang yaoxin
> 
>



Re: Review Request 52155: ambari server upgrade ambari to 2.1.1 duplicate key error

2016-11-20 Thread wang yaoxin

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

(Updated 十一月 21, 2016, 7:52 a.m.)


Review request for Ambari, Jonathan Hurley, Oliver Szabo, Robert Nettleton, and 
Sebastian Toader.


Bugs: AMBARI-18441
https://issues.apache.org/jira/browse/AMBARI-18441


Repository: ambari


Description
---

My first upgrade test failed due to my environment issue. Since in real 
production environment this failure would  occur again.

ambari upgrade to 2.1.1 and later version, if the first time failed , excute 
ambari-server upgrade again will error duplicate key value violates unique 
constraint "pk_hostcomponentstate".


Diffs (updated)
-

  
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
 db13612 

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


Testing
---

the unit test is UpgradeCatalog211Test.java: Process finished with exit code 0.
done !


File Attachments


AMBARI-18441-02.patch
  
https://reviews.apache.org/media/uploaded/files/2016/11/16/4c6f3d15-96cc-4c22-babe-b45b103a8c30__AMBARI-18441-02.patch


Thanks,

wang yaoxin



Re: Review Request 52155: ambari server upgrade ambari to 2.1.1 duplicate key error

2016-11-15 Thread wang yaoxin


> On 九月 27, 2016, 12:39 p.m., Jonathan Hurley wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java,
> >  lines 225-226
> > 
> >
> > This doesn't guarantee ordering of any kind - the first one which comes 
> > back could have an ID of 9. Since it doesn't match `m_hcsId`, this code 
> > would try to update it to to a value of 1 and possibly cause duplicates.
> > 
> > You can simply skip this whole section of updating if the 
> > `resultSet.getLong("id")` is non-null/non-zero. 
> > 
> > You can then so something like this:
> > `m_hcsId.set(NumberUtils.max(m_hcsId.get(), idKey)`
> 
> wang yaoxin wrote:
> Hi Jonathan ,Thanks for your advice, that is highly appreciated. However, 
> consider the randomness of the value of idKey, my method may avoid this 
> issue. For instance, if the first-time get value of resultSet.getLong("id") 
> is 2, and the second-time get value is 1, then basing on your method, the 
> duplicates error would still occur. Hope we could get further agreement on 
> this case, thanks.
> 
> Jonathan Hurley wrote:
> The problem here is on the 2nd time through, correct? If the first time 
> through it only did half of them (for some reason) then you're left with some 
> rows having an ID and some not. My point is to totally skip rows which have a 
> valid ID - you can sort by ID so you go through all of them first, 
> incrementing m_hceId along the way. This way, you're going to be guaranteed 
> to go through your non-zero IDs first and when you finally hit your first 
> null ID, you're atomic counter is ready to pickup.

Hi Jonathan ,Thanks for? I understand what you mean, and I've made the 
modification basing on your advice in AMBARI-18441-02.patch


- wang


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


On 九月 27, 2016, 12:03 p.m., wang yaoxin wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52155/
> ---
> 
> (Updated 九月 27, 2016, 12:03 p.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Oliver Szabo, Robert Nettleton, 
> and Sebastian Toader.
> 
> 
> Bugs: AMBARI-18441
> https://issues.apache.org/jira/browse/AMBARI-18441
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> My first upgrade test failed due to my environment issue. Since in real 
> production environment this failure would  occur again.
> 
> ambari upgrade to 2.1.1 and later version, if the first time failed , excute 
> ambari-server upgrade again will error duplicate key value violates unique 
> constraint "pk_hostcomponentstate".
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
>  db13612 
> 
> Diff: https://reviews.apache.org/r/52155/diff/
> 
> 
> Testing
> ---
> 
> the unit test is UpgradeCatalog211Test.java: Process finished with exit code 
> 0.
> done !
> 
> 
> Thanks,
> 
> wang yaoxin
> 
>



Re: Review Request 52155: ambari server upgrade ambari to 2.1.1 duplicate key error

2016-11-15 Thread wang yaoxin

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

(Updated 十一月 16, 2016, 6:49 a.m.)


Review request for Ambari, Jonathan Hurley, Oliver Szabo, Robert Nettleton, and 
Sebastian Toader.


Bugs: AMBARI-18441
https://issues.apache.org/jira/browse/AMBARI-18441


Repository: ambari


Description
---

My first upgrade test failed due to my environment issue. Since in real 
production environment this failure would  occur again.

ambari upgrade to 2.1.1 and later version, if the first time failed , excute 
ambari-server upgrade again will error duplicate key value violates unique 
constraint "pk_hostcomponentstate".


Diffs
-

  
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
 db13612 

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


Testing
---

the unit test is UpgradeCatalog211Test.java: Process finished with exit code 0.
done !


File Attachments (updated)


AMBARI-18441-02.patch
  
https://reviews.apache.org/media/uploaded/files/2016/11/16/4c6f3d15-96cc-4c22-babe-b45b103a8c30__AMBARI-18441-02.patch


Thanks,

wang yaoxin



Re: Review Request 52155: ambari server upgrade ambari to 2.1.1 duplicate key error

2016-11-15 Thread Jonathan Hurley


> On Sept. 27, 2016, 8:39 a.m., Jonathan Hurley wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java,
> >  lines 225-226
> > 
> >
> > This doesn't guarantee ordering of any kind - the first one which comes 
> > back could have an ID of 9. Since it doesn't match `m_hcsId`, this code 
> > would try to update it to to a value of 1 and possibly cause duplicates.
> > 
> > You can simply skip this whole section of updating if the 
> > `resultSet.getLong("id")` is non-null/non-zero. 
> > 
> > You can then so something like this:
> > `m_hcsId.set(NumberUtils.max(m_hcsId.get(), idKey)`
> 
> wang yaoxin wrote:
> Hi Jonathan ,Thanks for your advice, that is highly appreciated. However, 
> consider the randomness of the value of idKey, my method may avoid this 
> issue. For instance, if the first-time get value of resultSet.getLong("id") 
> is 2, and the second-time get value is 1, then basing on your method, the 
> duplicates error would still occur. Hope we could get further agreement on 
> this case, thanks.

The problem here is on the 2nd time through, correct? If the first time through 
it only did half of them (for some reason) then you're left with some rows 
having an ID and some not. My point is to totally skip rows which have a valid 
ID - you can sort by ID so you go through all of them first, incrementing 
m_hceId along the way. This way, you're going to be guaranteed to go through 
your non-zero IDs first and when you finally hit your first null ID, you're 
atomic counter is ready to pickup.


- Jonathan


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


On Sept. 27, 2016, 8:03 a.m., wang yaoxin wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52155/
> ---
> 
> (Updated Sept. 27, 2016, 8:03 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Oliver Szabo, Robert Nettleton, 
> and Sebastian Toader.
> 
> 
> Bugs: AMBARI-18441
> https://issues.apache.org/jira/browse/AMBARI-18441
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> My first upgrade test failed due to my environment issue. Since in real 
> production environment this failure would  occur again.
> 
> ambari upgrade to 2.1.1 and later version, if the first time failed , excute 
> ambari-server upgrade again will error duplicate key value violates unique 
> constraint "pk_hostcomponentstate".
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
>  db13612 
> 
> Diff: https://reviews.apache.org/r/52155/diff/
> 
> 
> Testing
> ---
> 
> the unit test is UpgradeCatalog211Test.java: Process finished with exit code 
> 0.
> done !
> 
> 
> Thanks,
> 
> wang yaoxin
> 
>



Re: Review Request 52155: ambari server upgrade ambari to 2.1.1 duplicate key error

2016-11-15 Thread Alejandro Fernandez

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


Ship it!




Ship It!

- Alejandro Fernandez


On Sept. 27, 2016, 12:03 p.m., wang yaoxin wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52155/
> ---
> 
> (Updated Sept. 27, 2016, 12:03 p.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Oliver Szabo, Robert Nettleton, 
> and Sebastian Toader.
> 
> 
> Bugs: AMBARI-18441
> https://issues.apache.org/jira/browse/AMBARI-18441
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> My first upgrade test failed due to my environment issue. Since in real 
> production environment this failure would  occur again.
> 
> ambari upgrade to 2.1.1 and later version, if the first time failed , excute 
> ambari-server upgrade again will error duplicate key value violates unique 
> constraint "pk_hostcomponentstate".
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
>  db13612 
> 
> Diff: https://reviews.apache.org/r/52155/diff/
> 
> 
> Testing
> ---
> 
> the unit test is UpgradeCatalog211Test.java: Process finished with exit code 
> 0.
> done !
> 
> 
> Thanks,
> 
> wang yaoxin
> 
>



Re: Review Request 52155: ambari server upgrade ambari to 2.1.1 duplicate key error

2016-11-15 Thread wang yaoxin


> On 九月 27, 2016, 12:39 p.m., Jonathan Hurley wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java,
> >  lines 225-226
> > 
> >
> > This doesn't guarantee ordering of any kind - the first one which comes 
> > back could have an ID of 9. Since it doesn't match `m_hcsId`, this code 
> > would try to update it to to a value of 1 and possibly cause duplicates.
> > 
> > You can simply skip this whole section of updating if the 
> > `resultSet.getLong("id")` is non-null/non-zero. 
> > 
> > You can then so something like this:
> > `m_hcsId.set(NumberUtils.max(m_hcsId.get(), idKey)`

Hi Jonathan ,Thanks for your advice, that is highly appreciated. However, 
consider the randomness of the value of idKey, my method may avoid this issue. 
For instance, if the first-time get value of resultSet.getLong("id") is 2, and 
the second-time get value is 1, then basing on your method, the duplicates 
error would still occur. Hope we could get further agreement on this case, 
thanks.


- wang


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


On 九月 27, 2016, 12:03 p.m., wang yaoxin wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52155/
> ---
> 
> (Updated 九月 27, 2016, 12:03 p.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Oliver Szabo, Robert Nettleton, 
> and Sebastian Toader.
> 
> 
> Bugs: AMBARI-18441
> https://issues.apache.org/jira/browse/AMBARI-18441
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> My first upgrade test failed due to my environment issue. Since in real 
> production environment this failure would  occur again.
> 
> ambari upgrade to 2.1.1 and later version, if the first time failed , excute 
> ambari-server upgrade again will error duplicate key value violates unique 
> constraint "pk_hostcomponentstate".
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
>  db13612 
> 
> Diff: https://reviews.apache.org/r/52155/diff/
> 
> 
> Testing
> ---
> 
> the unit test is UpgradeCatalog211Test.java: Process finished with exit code 
> 0.
> done !
> 
> 
> Thanks,
> 
> wang yaoxin
> 
>



Re: Review Request 52155: ambari server upgrade ambari to 2.1.1 duplicate key error

2016-09-27 Thread Jonathan Hurley

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




ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
 (lines 225 - 226)


This doesn't guarantee ordering of any kind - the first one which comes 
back could have an ID of 9. Since it doesn't match `m_hcsId`, this code would 
try to update it to to a value of 1 and possibly cause duplicates.

You can simply skip this whole section of updating if the 
`resultSet.getLong("id")` is non-null/non-zero. 

You can then so something like this:
`m_hcsId.set(NumberUtils.max(m_hcsId.get(), idKey)`


- Jonathan Hurley


On Sept. 27, 2016, 8:03 a.m., wang yaoxin wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52155/
> ---
> 
> (Updated Sept. 27, 2016, 8:03 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Oliver Szabo, Robert Nettleton, 
> and Sebastian Toader.
> 
> 
> Bugs: AMBARI-18441
> https://issues.apache.org/jira/browse/AMBARI-18441
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> My first upgrade test failed due to my environment issue. Since in real 
> production environment this failure would  occur again.
> 
> ambari upgrade to 2.1.1 and later version, if the first time failed , excute 
> ambari-server upgrade again will error duplicate key value violates unique 
> constraint "pk_hostcomponentstate".
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
>  db13612 
> 
> Diff: https://reviews.apache.org/r/52155/diff/
> 
> 
> Testing
> ---
> 
> the unit test is UpgradeCatalog211Test.java: Process finished with exit code 
> 0.
> done !
> 
> 
> Thanks,
> 
> wang yaoxin
> 
>



Re: Review Request 52155: ambari server upgrade ambari to 2.1.1 duplicate key error

2016-09-27 Thread wang yaoxin

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

(Updated 九月 27, 2016, 12:03 p.m.)


Review request for Ambari, Jonathan Hurley, Oliver Szabo, Robert Nettleton, and 
Sebastian Toader.


Bugs: AMBARI-18441
https://issues.apache.org/jira/browse/AMBARI-18441


Repository: ambari


Description (updated)
---

My first upgrade test failed due to my environment issue. Since in real 
production environment this failure would  occur again.

ambari upgrade to 2.1.1 and later version, if the first time failed , excute 
ambari-server upgrade again will error duplicate key value violates unique 
constraint "pk_hostcomponentstate".


Diffs
-

  
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
 db13612 

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


Testing
---

the unit test is UpgradeCatalog211Test.java: Process finished with exit code 0.
done !


Thanks,

wang yaoxin



Re: Review Request 52155: ambari server upgrade ambari to 2.1.1 duplicate key error

2016-09-22 Thread wang yaoxin


> On 九月 22, 2016, 4:21 p.m., Jonathan Hurley wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java,
> >  lines 204-207
> > 
> >
> > Wouldn't this prevent the method from being executed again?
> 
> wang yaoxin wrote:
> My first upgrade test failed due to my environment issue. Since in real 
> production environment this failure would  occur again, I am now submit the 
> patch for the purpose of optimizing the entire section of code

Thnaks ,Jonathan !


- wang


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


On 九月 23, 2016, 4:58 a.m., wang yaoxin wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52155/
> ---
> 
> (Updated 九月 23, 2016, 4:58 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Oliver Szabo, Robert Nettleton, 
> and Sebastian Toader.
> 
> 
> Bugs: AMBARI-18441
> https://issues.apache.org/jira/browse/AMBARI-18441
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> ambari upgrade to 2.1.1, if the first time failed , excute ambari-server 
> upgrade again will error duplicate key value violates unique constraint 
> "pk_hostcomponentstate".
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
>  db13612 
> 
> Diff: https://reviews.apache.org/r/52155/diff/
> 
> 
> Testing
> ---
> 
> the unit test is UpgradeCatalog211Test.java: Process finished with exit code 
> 0.
> done !
> 
> 
> Thanks,
> 
> wang yaoxin
> 
>



Re: Review Request 52155: ambari server upgrade ambari to 2.1.1 duplicate key error

2016-09-22 Thread wang yaoxin


> On 九月 22, 2016, 4:21 p.m., Jonathan Hurley wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java,
> >  lines 204-207
> > 
> >
> > Wouldn't this prevent the method from being executed again?

My first upgrade test failed due to my environment issue. Since in real 
production environment this failure would  occur again, I am now submit the 
patch for the purpose of optimizing the entire section of code


- wang


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


On 九月 22, 2016, 11:08 a.m., wang yaoxin wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52155/
> ---
> 
> (Updated 九月 22, 2016, 11:08 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Oliver Szabo, Robert Nettleton, 
> and Sebastian Toader.
> 
> 
> Bugs: AMBARI-18441
> https://issues.apache.org/jira/browse/AMBARI-18441
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> ambari upgrade to 2.1.1, if the first time failed , excute ambari-server 
> upgrade again will error duplicate key value violates unique constraint 
> "pk_hostcomponentstate".
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
>  db13612 
> 
> Diff: https://reviews.apache.org/r/52155/diff/
> 
> 
> Testing
> ---
> 
> the unit test is UpgradeCatalog211Test.java: Process finished with exit code 
> 0.
> done !
> 
> 
> Thanks,
> 
> wang yaoxin
> 
>



Re: Review Request 52155: ambari server upgrade ambari to 2.1.1 duplicate key error

2016-09-22 Thread wang yaoxin

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

(Updated 九月 23, 2016, 4:58 a.m.)


Review request for Ambari, Jonathan Hurley, Oliver Szabo, Robert Nettleton, and 
Sebastian Toader.


Bugs: AMBARI-18441
https://issues.apache.org/jira/browse/AMBARI-18441


Repository: ambari


Description
---

ambari upgrade to 2.1.1, if the first time failed , excute ambari-server 
upgrade again will error duplicate key value violates unique constraint 
"pk_hostcomponentstate".


Diffs (updated)
-

  
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
 db13612 

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


Testing
---

the unit test is UpgradeCatalog211Test.java: Process finished with exit code 0.
done !


Thanks,

wang yaoxin



Re: Review Request 52155: ambari server upgrade ambari to 2.1.1 duplicate key error

2016-09-22 Thread Jonathan Hurley

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




ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
 (lines 204 - 207)


Wouldn't this prevent the method from being executed again?



ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
 (line 225)


You're not asking for the "id" column in the SQL - how is it present here?



ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
 (lines 228 - 229)


Why did you remove hte `,number,#` ? I believe it's needed to prevent 
formatting of the number using commas or periods.


- Jonathan Hurley


On Sept. 22, 2016, 7:08 a.m., wang yaoxin wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52155/
> ---
> 
> (Updated Sept. 22, 2016, 7:08 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Oliver Szabo, Robert Nettleton, 
> and Sebastian Toader.
> 
> 
> Bugs: AMBARI-18441
> https://issues.apache.org/jira/browse/AMBARI-18441
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> ambari upgrade to 2.1.1, if the first time failed , excute ambari-server 
> upgrade again will error duplicate key value violates unique constraint 
> "pk_hostcomponentstate".
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
>  db13612 
> 
> Diff: https://reviews.apache.org/r/52155/diff/
> 
> 
> Testing
> ---
> 
> the unit test is UpgradeCatalog211Test.java: Process finished with exit code 
> 0.
> done !
> 
> 
> Thanks,
> 
> wang yaoxin
> 
>



Review Request 52155: ambari server upgrade ambari to 2.1.1 duplicate key error

2016-09-22 Thread wang yaoxin

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

Review request for Ambari, Jonathan Hurley, Oliver Szabo, Robert Nettleton, and 
Sebastian Toader.


Bugs: AMBARI-18441
https://issues.apache.org/jira/browse/AMBARI-18441


Repository: ambari


Description
---

ambari upgrade to 2.1.1, if the first time failed , excute ambari-server 
upgrade again will error duplicate key value violates unique constraint 
"pk_hostcomponentstate".


Diffs
-

  
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
 db13612 

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


Testing
---

the unit test is UpgradeCatalog211Test.java: Process finished with exit code 0.
done !


Thanks,

wang yaoxin