You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Alejandro Fernandez <af...@hortonworks.com> on 2015/04/29 03:51:40 UTC

Review Request 33655: Full Delete of Host : Fix UpgradeCatalogs to handle host-related changes in 1.6.1, 1.7.0, and 2.0.0 after refactoring Entity models

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

Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Sumit Mohanty, and Sid Wagle.


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


Repository: ambari


Description
-------

The older upgrade catalogs cannot use any of Entity models that are related to the hosts table because the host_name is no longer present (instead the host_id).
For this reason, I changed the UpgradeCatalogs to use raw SQL.


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java ac8bb52 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java 23ffad0 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java 4117a1c 
  ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java 804aa60 

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


Testing
-------

Created VMs with each of the following Ambari versions and tested these upgrade paths.
                           2.0.0 -> 2.1.0 (has known issues due to XML properties)
                  1.7.0 -> 2.0.0 -> 2.1.0 (has known issues due to the stacks table, this removed Nagios service, which was tested in UpgradeCatalog200)
         1.6.1 -> 1.7.0 -> 2.0.0 -> 2.1.0 (has known issues due to the stacks table, this updated the host_role_command table, which was tested in UpgradeCatalog170)
1.6.0 -> 1.6.1 -> 1.7.0 -> 2.0.0 -> 2.1.0

To get these work, I had to comment out certain functions that are known to fail today.

I ran local unit tests on ambari-server/src/test/java/org/apache/ambari/server/upgrade and they passed.


Thanks,

Alejandro Fernandez


Re: Review Request 33655: Full Delete of Host : Fix UpgradeCatalogs to handle host-related changes in 1.6.1, 1.7.0, and 2.0.0 after refactoring Entity models

Posted by Alejandro Fernandez <af...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33655/#review81918
-----------------------------------------------------------



ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
<https://reviews.apache.org/r/33655/#comment132474>

    I verified the Oracle statements at
    http://sqlfiddle.com/#!4/78116a/2


- Alejandro Fernandez


On April 29, 2015, 1:51 a.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33655/
> -----------------------------------------------------------
> 
> (Updated April 29, 2015, 1:51 a.m.)
> 
> 
> Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Sumit Mohanty, and Sid Wagle.
> 
> 
> Bugs: AMBARI-10170
>     https://issues.apache.org/jira/browse/AMBARI-10170
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> The older upgrade catalogs cannot use any of Entity models that are related to the hosts table because the host_name is no longer present (instead the host_id).
> For this reason, I changed the UpgradeCatalogs to use raw SQL.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java ac8bb52 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java 23ffad0 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java 4117a1c 
>   ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java 804aa60 
> 
> Diff: https://reviews.apache.org/r/33655/diff/
> 
> 
> Testing
> -------
> 
> Created VMs with each of the following Ambari versions and tested these upgrade paths.
>                            2.0.0 -> 2.1.0 (has known issues due to XML properties)
>                   1.7.0 -> 2.0.0 -> 2.1.0 (has known issues due to the stacks table, this removed Nagios service, which was tested in UpgradeCatalog200)
>          1.6.1 -> 1.7.0 -> 2.0.0 -> 2.1.0 (has known issues due to the stacks table, this updated the host_role_command table, which was tested in UpgradeCatalog170)
> 1.6.0 -> 1.6.1 -> 1.7.0 -> 2.0.0 -> 2.1.0
> 
> To get these work, I had to comment out certain functions that are known to fail today.
> 
> I ran local unit tests on ambari-server/src/test/java/org/apache/ambari/server/upgrade and they passed.
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


Re: Review Request 33655: Full Delete of Host : Fix UpgradeCatalogs to handle host-related changes in 1.6.1, 1.7.0, and 2.0.0 after refactoring Entity models

Posted by Alejandro Fernandez <af...@hortonworks.com>.

> On April 30, 2015, 7:22 p.m., Jonathan Hurley wrote:
> > It's still hard to believe we need to move away from entities, but I guess we're handcuffed with our upgrade framework here. I still dislike this whole raw SQL approach. There's no way to run pre-upgrade code that creates the associations the entities need? I mean, in this case, it's changing host name to ID in a bunch of tables; once that's done won't all of the entities just work? 
> > 
> > What if you did the necessary association work before any of the DML updates. Thoughts?

Eventually I want to find an elegant and simple solution for this. For the purposes of getting it to work, I'm ok with using raw SQL.


- Alejandro


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


On April 29, 2015, 10:24 p.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33655/
> -----------------------------------------------------------
> 
> (Updated April 29, 2015, 10:24 p.m.)
> 
> 
> Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Sumit Mohanty, and Sid Wagle.
> 
> 
> Bugs: AMBARI-10170
>     https://issues.apache.org/jira/browse/AMBARI-10170
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> The older upgrade catalogs cannot use any of Entity models that are related to the hosts table because the host_name is no longer present (instead the host_id).
> For this reason, I changed the UpgradeCatalogs to use raw SQL.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessor.java 2b01c72 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java 29cf755 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java 940be93 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java ac8bb52 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java 23ffad0 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java 4117a1c 
>   ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java 804aa60 
> 
> Diff: https://reviews.apache.org/r/33655/diff/
> 
> 
> Testing
> -------
> 
> Created VMs with each of the following Ambari versions and tested these upgrade paths.
>                            2.0.0 -> 2.1.0 (has known issues due to XML properties)
>                   1.7.0 -> 2.0.0 -> 2.1.0 (has known issues due to the stacks table, this removed Nagios service, which was tested in UpgradeCatalog200)
>          1.6.1 -> 1.7.0 -> 2.0.0 -> 2.1.0 (has known issues due to the stacks table, this updated the host_role_command table, which was tested in UpgradeCatalog170)
> 1.6.0 -> 1.6.1 -> 1.7.0 -> 2.0.0 -> 2.1.0
> 
> To get these work, I had to comment out certain functions that are known to fail today.
> 
> I ran local unit tests on ambari-server/src/test/java/org/apache/ambari/server/upgrade and they passed.
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


Re: Review Request 33655: Full Delete of Host : Fix UpgradeCatalogs to handle host-related changes in 1.6.1, 1.7.0, and 2.0.0 after refactoring Entity models

Posted by Jonathan Hurley <jh...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33655/#review82183
-----------------------------------------------------------

Ship it!


It's still hard to believe we need to move away from entities, but I guess we're handcuffed with our upgrade framework here. I still dislike this whole raw SQL approach. There's no way to run pre-upgrade code that creates the associations the entities need? I mean, in this case, it's changing host name to ID in a bunch of tables; once that's done won't all of the entities just work? 

What if you did the necessary association work before any of the DML updates. Thoughts?

- Jonathan Hurley


On April 29, 2015, 6:24 p.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33655/
> -----------------------------------------------------------
> 
> (Updated April 29, 2015, 6:24 p.m.)
> 
> 
> Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Sumit Mohanty, and Sid Wagle.
> 
> 
> Bugs: AMBARI-10170
>     https://issues.apache.org/jira/browse/AMBARI-10170
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> The older upgrade catalogs cannot use any of Entity models that are related to the hosts table because the host_name is no longer present (instead the host_id).
> For this reason, I changed the UpgradeCatalogs to use raw SQL.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessor.java 2b01c72 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java 29cf755 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java 940be93 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java ac8bb52 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java 23ffad0 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java 4117a1c 
>   ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java 804aa60 
> 
> Diff: https://reviews.apache.org/r/33655/diff/
> 
> 
> Testing
> -------
> 
> Created VMs with each of the following Ambari versions and tested these upgrade paths.
>                            2.0.0 -> 2.1.0 (has known issues due to XML properties)
>                   1.7.0 -> 2.0.0 -> 2.1.0 (has known issues due to the stacks table, this removed Nagios service, which was tested in UpgradeCatalog200)
>          1.6.1 -> 1.7.0 -> 2.0.0 -> 2.1.0 (has known issues due to the stacks table, this updated the host_role_command table, which was tested in UpgradeCatalog170)
> 1.6.0 -> 1.6.1 -> 1.7.0 -> 2.0.0 -> 2.1.0
> 
> To get these work, I had to comment out certain functions that are known to fail today.
> 
> I ran local unit tests on ambari-server/src/test/java/org/apache/ambari/server/upgrade and they passed.
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


Re: Review Request 33655: Full Delete of Host : Fix UpgradeCatalogs to handle host-related changes in 1.6.1, 1.7.0, and 2.0.0 after refactoring Entity models

Posted by Jonathan Hurley <jh...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33655/#review82243
-----------------------------------------------------------

Ship it!


Ship It!

- Jonathan Hurley


On April 30, 2015, 6:02 p.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33655/
> -----------------------------------------------------------
> 
> (Updated April 30, 2015, 6:02 p.m.)
> 
> 
> Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Sumit Mohanty, and Sid Wagle.
> 
> 
> Bugs: AMBARI-10170
>     https://issues.apache.org/jira/browse/AMBARI-10170
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Throughout refactoring the host_name => host_id changes, the UpgradeCatalogs wouldn't work due to the host-entities not being correct. Now that they are are finalized with the Foreign Keys, the UpgradeCatalogs don't generate any host errors any longer.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java 940be93 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java 1d6095b 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog.java f482dc2 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog150.java 03b995a 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog151.java cd3945a 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog160.java ac32081 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java ac8bb52 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java 23ffad0 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java 4117a1c 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java c7866db 
>   ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java d150d76 
>   ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalogTest.java eb53b03 
>   ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeTest.java b9b01f8 
> 
> Diff: https://reviews.apache.org/r/33655/diff/
> 
> 
> Testing
> -------
> 
> Created VMs with each of the following Ambari versions and tested these upgrade paths.
>                            2.0.0 -> 2.1.0 (has known issues due to XML properties)
>                   1.7.0 -> 2.0.0 -> 2.1.0 (has known issues due to the stacks table, this removed Nagios service, which was tested in UpgradeCatalog200)
>          1.6.1 -> 1.7.0 -> 2.0.0 -> 2.1.0 (has known issues due to the stacks table, this updated the host_role_command table, which was tested in UpgradeCatalog170)
> 1.6.0 -> 1.6.1 -> 1.7.0 -> 2.0.0 -> 2.1.0
> 
> To get these work, I had to comment out certain functions that are known to fail today.
> 
> I ran local unit tests on ambari-server/src/test/java/org/apache/ambari/server/upgrade and they passed.
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


Re: Review Request 33655: Full Delete of Host : Fix UpgradeCatalogs to handle host-related changes in 1.6.1, 1.7.0, and 2.0.0 after refactoring Entity models

Posted by Alejandro Fernandez <af...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33655/#review82208
-----------------------------------------------------------



ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java
<https://reviews.apache.org/r/33655/#comment132905>

    No longer needed.



ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java
<https://reviews.apache.org/r/33655/#comment132906>

    In UpgradeCatalog210, this is used for the stacks.



ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalogTest.java
<https://reviews.apache.org/r/33655/#comment132907>

    Test case is no longer needed.


- Alejandro Fernandez


On April 30, 2015, 10:02 p.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33655/
> -----------------------------------------------------------
> 
> (Updated April 30, 2015, 10:02 p.m.)
> 
> 
> Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Sumit Mohanty, and Sid Wagle.
> 
> 
> Bugs: AMBARI-10170
>     https://issues.apache.org/jira/browse/AMBARI-10170
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Throughout refactoring the host_name => host_id changes, the UpgradeCatalogs wouldn't work due to the host-entities not being correct. Now that they are are finalized with the Foreign Keys, the UpgradeCatalogs don't generate any host errors any longer.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java 940be93 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java 1d6095b 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog.java f482dc2 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog150.java 03b995a 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog151.java cd3945a 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog160.java ac32081 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java ac8bb52 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java 23ffad0 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java 4117a1c 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java c7866db 
>   ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java d150d76 
>   ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalogTest.java eb53b03 
>   ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeTest.java b9b01f8 
> 
> Diff: https://reviews.apache.org/r/33655/diff/
> 
> 
> Testing
> -------
> 
> Created VMs with each of the following Ambari versions and tested these upgrade paths.
>                            2.0.0 -> 2.1.0 (has known issues due to XML properties)
>                   1.7.0 -> 2.0.0 -> 2.1.0 (has known issues due to the stacks table, this removed Nagios service, which was tested in UpgradeCatalog200)
>          1.6.1 -> 1.7.0 -> 2.0.0 -> 2.1.0 (has known issues due to the stacks table, this updated the host_role_command table, which was tested in UpgradeCatalog170)
> 1.6.0 -> 1.6.1 -> 1.7.0 -> 2.0.0 -> 2.1.0
> 
> To get these work, I had to comment out certain functions that are known to fail today.
> 
> I ran local unit tests on ambari-server/src/test/java/org/apache/ambari/server/upgrade and they passed.
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


Re: Review Request 33655: Full Delete of Host : Fix UpgradeCatalogs to handle host-related changes in 1.6.1, 1.7.0, and 2.0.0 after refactoring Entity models

Posted by Alejandro Fernandez <af...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33655/
-----------------------------------------------------------

(Updated April 30, 2015, 10:02 p.m.)


Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Sumit Mohanty, and Sid Wagle.


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


Repository: ambari


Description (updated)
-------

Throughout refactoring the host_name => host_id changes, the UpgradeCatalogs wouldn't work due to the host-entities not being correct. Now that they are are finalized with the Foreign Keys, the UpgradeCatalogs don't generate any host errors any longer.


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java 940be93 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java 1d6095b 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog.java f482dc2 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog150.java 03b995a 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog151.java cd3945a 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog160.java ac32081 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java ac8bb52 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java 23ffad0 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java 4117a1c 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java c7866db 
  ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java d150d76 
  ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalogTest.java eb53b03 
  ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeTest.java b9b01f8 

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


Testing
-------

Created VMs with each of the following Ambari versions and tested these upgrade paths.
                           2.0.0 -> 2.1.0 (has known issues due to XML properties)
                  1.7.0 -> 2.0.0 -> 2.1.0 (has known issues due to the stacks table, this removed Nagios service, which was tested in UpgradeCatalog200)
         1.6.1 -> 1.7.0 -> 2.0.0 -> 2.1.0 (has known issues due to the stacks table, this updated the host_role_command table, which was tested in UpgradeCatalog170)
1.6.0 -> 1.6.1 -> 1.7.0 -> 2.0.0 -> 2.1.0

To get these work, I had to comment out certain functions that are known to fail today.

I ran local unit tests on ambari-server/src/test/java/org/apache/ambari/server/upgrade and they passed.


Thanks,

Alejandro Fernandez


Re: Review Request 33655: Full Delete of Host : Fix UpgradeCatalogs to handle host-related changes in 1.6.1, 1.7.0, and 2.0.0 after refactoring Entity models

Posted by Alejandro Fernandez <af...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33655/
-----------------------------------------------------------

(Updated April 30, 2015, 10:01 p.m.)


Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Sumit Mohanty, and Sid Wagle.


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


Repository: ambari


Description
-------

The older upgrade catalogs cannot use any of Entity models that are related to the hosts table because the host_name is no longer present (instead the host_id).
For this reason, I changed the UpgradeCatalogs to use raw SQL.


Diffs (updated)
-----

  ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java 940be93 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java 1d6095b 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog.java f482dc2 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog150.java 03b995a 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog151.java cd3945a 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog160.java ac32081 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java ac8bb52 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java 23ffad0 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java 4117a1c 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java c7866db 
  ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java d150d76 
  ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalogTest.java eb53b03 
  ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeTest.java b9b01f8 

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


Testing
-------

Created VMs with each of the following Ambari versions and tested these upgrade paths.
                           2.0.0 -> 2.1.0 (has known issues due to XML properties)
                  1.7.0 -> 2.0.0 -> 2.1.0 (has known issues due to the stacks table, this removed Nagios service, which was tested in UpgradeCatalog200)
         1.6.1 -> 1.7.0 -> 2.0.0 -> 2.1.0 (has known issues due to the stacks table, this updated the host_role_command table, which was tested in UpgradeCatalog170)
1.6.0 -> 1.6.1 -> 1.7.0 -> 2.0.0 -> 2.1.0

To get these work, I had to comment out certain functions that are known to fail today.

I ran local unit tests on ambari-server/src/test/java/org/apache/ambari/server/upgrade and they passed.


Thanks,

Alejandro Fernandez


Re: Review Request 33655: Full Delete of Host : Fix UpgradeCatalogs to handle host-related changes in 1.6.1, 1.7.0, and 2.0.0 after refactoring Entity models

Posted by Alejandro Fernandez <af...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33655/
-----------------------------------------------------------

(Updated April 29, 2015, 10:24 p.m.)


Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Sumit Mohanty, and Sid Wagle.


Changes
-------

Addressed Jonathan's comments.


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


Repository: ambari


Description
-------

The older upgrade catalogs cannot use any of Entity models that are related to the hosts table because the host_name is no longer present (instead the host_id).
For this reason, I changed the UpgradeCatalogs to use raw SQL.


Diffs (updated)
-----

  ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessor.java 2b01c72 
  ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java 29cf755 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java 940be93 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java ac8bb52 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java 23ffad0 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java 4117a1c 
  ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java 804aa60 

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


Testing
-------

Created VMs with each of the following Ambari versions and tested these upgrade paths.
                           2.0.0 -> 2.1.0 (has known issues due to XML properties)
                  1.7.0 -> 2.0.0 -> 2.1.0 (has known issues due to the stacks table, this removed Nagios service, which was tested in UpgradeCatalog200)
         1.6.1 -> 1.7.0 -> 2.0.0 -> 2.1.0 (has known issues due to the stacks table, this updated the host_role_command table, which was tested in UpgradeCatalog170)
1.6.0 -> 1.6.1 -> 1.7.0 -> 2.0.0 -> 2.1.0

To get these work, I had to comment out certain functions that are known to fail today.

I ran local unit tests on ambari-server/src/test/java/org/apache/ambari/server/upgrade and they passed.


Thanks,

Alejandro Fernandez


Re: Review Request 33655: Full Delete of Host : Fix UpgradeCatalogs to handle host-related changes in 1.6.1, 1.7.0, and 2.0.0 after refactoring Entity models

Posted by Alejandro Fernandez <af...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33655/#review81984
-----------------------------------------------------------



ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java
<https://reviews.apache.org/r/33655/#comment132542>

    You're right; I'll take another look.


- Alejandro Fernandez


On April 29, 2015, 1:51 a.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33655/
> -----------------------------------------------------------
> 
> (Updated April 29, 2015, 1:51 a.m.)
> 
> 
> Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Sumit Mohanty, and Sid Wagle.
> 
> 
> Bugs: AMBARI-10170
>     https://issues.apache.org/jira/browse/AMBARI-10170
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> The older upgrade catalogs cannot use any of Entity models that are related to the hosts table because the host_name is no longer present (instead the host_id).
> For this reason, I changed the UpgradeCatalogs to use raw SQL.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java ac8bb52 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java 23ffad0 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java 4117a1c 
>   ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java 804aa60 
> 
> Diff: https://reviews.apache.org/r/33655/diff/
> 
> 
> Testing
> -------
> 
> Created VMs with each of the following Ambari versions and tested these upgrade paths.
>                            2.0.0 -> 2.1.0 (has known issues due to XML properties)
>                   1.7.0 -> 2.0.0 -> 2.1.0 (has known issues due to the stacks table, this removed Nagios service, which was tested in UpgradeCatalog200)
>          1.6.1 -> 1.7.0 -> 2.0.0 -> 2.1.0 (has known issues due to the stacks table, this updated the host_role_command table, which was tested in UpgradeCatalog170)
> 1.6.0 -> 1.6.1 -> 1.7.0 -> 2.0.0 -> 2.1.0
> 
> To get these work, I had to comment out certain functions that are known to fail today.
> 
> I ran local unit tests on ambari-server/src/test/java/org/apache/ambari/server/upgrade and they passed.
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


Re: Review Request 33655: Full Delete of Host : Fix UpgradeCatalogs to handle host-related changes in 1.6.1, 1.7.0, and 2.0.0 after refactoring Entity models

Posted by Jonathan Hurley <jh...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33655/#review81976
-----------------------------------------------------------



ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java
<https://reviews.apache.org/r/33655/#comment132538>

    Won't this leave orphaned content in tables like clusterconfig and serviceconfig?


I'm curious ... wouldn't it be better to run something before the upgrade catalogs that sets up the data in the way the entities need it? Converting all of this to SQL doesn't seem like the best move.

- Jonathan Hurley


On April 28, 2015, 9:51 p.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33655/
> -----------------------------------------------------------
> 
> (Updated April 28, 2015, 9:51 p.m.)
> 
> 
> Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Sumit Mohanty, and Sid Wagle.
> 
> 
> Bugs: AMBARI-10170
>     https://issues.apache.org/jira/browse/AMBARI-10170
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> The older upgrade catalogs cannot use any of Entity models that are related to the hosts table because the host_name is no longer present (instead the host_id).
> For this reason, I changed the UpgradeCatalogs to use raw SQL.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java ac8bb52 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java 23ffad0 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java 4117a1c 
>   ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java 804aa60 
> 
> Diff: https://reviews.apache.org/r/33655/diff/
> 
> 
> Testing
> -------
> 
> Created VMs with each of the following Ambari versions and tested these upgrade paths.
>                            2.0.0 -> 2.1.0 (has known issues due to XML properties)
>                   1.7.0 -> 2.0.0 -> 2.1.0 (has known issues due to the stacks table, this removed Nagios service, which was tested in UpgradeCatalog200)
>          1.6.1 -> 1.7.0 -> 2.0.0 -> 2.1.0 (has known issues due to the stacks table, this updated the host_role_command table, which was tested in UpgradeCatalog170)
> 1.6.0 -> 1.6.1 -> 1.7.0 -> 2.0.0 -> 2.1.0
> 
> To get these work, I had to comment out certain functions that are known to fail today.
> 
> I ran local unit tests on ambari-server/src/test/java/org/apache/ambari/server/upgrade and they passed.
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>