You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@ambari.apache.org by Jonathan Hurley <jh...@hortonworks.com> on 2017/05/08 18:50:42 UTC
Review Request 59060: Host Version on Finalization Must Be Scoped
Correctly Based on Upgrade Type
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59060/
-----------------------------------------------------------
Review request for Ambari, Alejandro Fernandez, Dmytro Grinenko, Dmitro Lisnichenko, and Nate Cole.
Bugs: AMBARI-20958
https://issues.apache.org/jira/browse/AMBARI-20958
Repository: ambari
Description
-------
The {{host_version}} table must allow for multiple {{CURRENT}} versions. Finalization must be allowed to occur when not all hosts are targeted for upgrade.
During a {{PATCH}} or {{SERVICE}} upgrade, finalization will either fail or be incorrect based on the topology of the cluster. In cases where the upgraded service has components on every host, the {{host_version}} table is moved incorrectly to reflect the stack of the upgraded component.
h6. Topology (HDP 2.4.2.0-236)
- c6401 - ZooKeeper Server, ZooKeeper Client, Storm Nimbus
- c6402 - ZooKeeper Server, ZooKeeper Client, Storm Supervisor
- c6403 - ZooKeeper Server, ZooKeeper Client, Storm Supervisor
h6. {{SERVICE}} upgrade from to HDP-2.5.4.0-121 for {{STORM}} only:
{noformat}
Begin finalizing the upgrade of cluster c1 to version 2.5.4.0-121
Finalizing the upgraded state of host components in 3 host(s).
Finalizing the version for 3 host(s).
Finalizing the version for cluster c1.
Creating upgrade history.
Upgrade was successful!
{noformat}
{code}
ambari=# SELECT host_version.host_id, repo_version.version, state FROM host_version, repo_version WHERE host_version.repo_version_id = repo_version.repo_version_id ORDER BY version, host_id;
host_id | version | state
---------+-------------+-----------
1 | 2.4.2.0-236 | INSTALLED
2 | 2.4.2.0-236 | INSTALLED
3 | 2.4.2.0-236 | INSTALLED
1 | 2.5.4.0-121 | CURRENT
2 | 2.5.4.0-121 | CURRENT
3 | 2.5.4.0-121 | CURRENT
(6 rows)
{code}
In the event that {{STORM}} is not installed on all hosts, finalization fails:
h6. Topology (HDP 2.4.2.0-236)
- c6401 - ZooKeeper Server, ZooKeeper Client, Storm Nimbus
- c6402 - ZooKeeper Server, ZooKeeper Client, Storm Supervisor
- c6403 - ZooKeeper Server, ZooKeeper Client
{noformat}
Begin finalizing the upgrade of cluster c1 to version 2.5.4.0-121
The following 1 host(s) have not been upgraded to version 2.5.4.0-121. Please install and upgrade the Stack Version on those hosts and try again.
Hosts: c6403.ambari.apache.org
{noformat}
Diffs
-----
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java fd52a3f
ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java 33c622f
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ClusterVersionDAO.java 1bcca60
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java 6174912
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostVersionDAO.java 3871b67
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostVersionEntity.java 9be30a3
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java f5d669e
ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java a4cc757
ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 88c5a59
ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java b7f8d29
ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 21c275b
ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java 056959e
ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java 75d5fa6
ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql c2a9239
ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 48d2c35
ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql 26201fc
ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 156fc08
ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql 979ea44
ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 08c71ff
Diff: https://reviews.apache.org/r/59060/diff/1/
Testing
-------
PENDING
Thanks,
Jonathan Hurley
Re: Review Request 59060: Host Version on Finalization Must Be Scoped
Correctly Based on Upgrade Type
Posted by Jonathan Hurley <jh...@hortonworks.com>.
> On May 9, 2017, 12:24 p.m., Nate Cole wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java
> > Line 112 (original), 104 (patched)
> > <https://reviews.apache.org/r/59060/diff/1/?file=1710742#file1710742line112>
> >
> > nit: formatting :)
If I had a nickel every time you pointed out my extra spaces... It's a hard habit to break :)
- Jonathan
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59060/#review174333
-----------------------------------------------------------
On May 8, 2017, 2:50 p.m., Jonathan Hurley wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59060/
> -----------------------------------------------------------
>
> (Updated May 8, 2017, 2:50 p.m.)
>
>
> Review request for Ambari, Alejandro Fernandez, Dmytro Grinenko, Dmitro Lisnichenko, and Nate Cole.
>
>
> Bugs: AMBARI-20958
> https://issues.apache.org/jira/browse/AMBARI-20958
>
>
> Repository: ambari
>
>
> Description
> -------
>
> The {{host_version}} table must allow for multiple {{CURRENT}} versions. Finalization must be allowed to occur when not all hosts are targeted for upgrade.
>
> During a {{PATCH}} or {{SERVICE}} upgrade, finalization will either fail or be incorrect based on the topology of the cluster. In cases where the upgraded service has components on every host, the {{host_version}} table is moved incorrectly to reflect the stack of the upgraded component.
>
> h6. Topology (HDP 2.4.2.0-236)
> - c6401 - ZooKeeper Server, ZooKeeper Client, Storm Nimbus
> - c6402 - ZooKeeper Server, ZooKeeper Client, Storm Supervisor
> - c6403 - ZooKeeper Server, ZooKeeper Client, Storm Supervisor
>
> h6. {{SERVICE}} upgrade from to HDP-2.5.4.0-121 for {{STORM}} only:
>
> {noformat}
> Begin finalizing the upgrade of cluster c1 to version 2.5.4.0-121
> Finalizing the upgraded state of host components in 3 host(s).
> Finalizing the version for 3 host(s).
> Finalizing the version for cluster c1.
> Creating upgrade history.
> Upgrade was successful!
> {noformat}
>
> {code}
> ambari=# SELECT host_version.host_id, repo_version.version, state FROM host_version, repo_version WHERE host_version.repo_version_id = repo_version.repo_version_id ORDER BY version, host_id;
> host_id | version | state
> ---------+-------------+-----------
> 1 | 2.4.2.0-236 | INSTALLED
> 2 | 2.4.2.0-236 | INSTALLED
> 3 | 2.4.2.0-236 | INSTALLED
> 1 | 2.5.4.0-121 | CURRENT
> 2 | 2.5.4.0-121 | CURRENT
> 3 | 2.5.4.0-121 | CURRENT
> (6 rows)
> {code}
>
> In the event that {{STORM}} is not installed on all hosts, finalization fails:
> h6. Topology (HDP 2.4.2.0-236)
> - c6401 - ZooKeeper Server, ZooKeeper Client, Storm Nimbus
> - c6402 - ZooKeeper Server, ZooKeeper Client, Storm Supervisor
> - c6403 - ZooKeeper Server, ZooKeeper Client
>
> {noformat}
> Begin finalizing the upgrade of cluster c1 to version 2.5.4.0-121
> The following 1 host(s) have not been upgraded to version 2.5.4.0-121. Please install and upgrade the Stack Version on those hosts and try again.
> Hosts: c6403.ambari.apache.org
> {noformat}
>
>
> Diffs
> -----
>
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java fd52a3f
> ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java 33c622f
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ClusterVersionDAO.java 1bcca60
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java 6174912
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostVersionDAO.java 3871b67
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostVersionEntity.java 9be30a3
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java f5d669e
> ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java a4cc757
> ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 88c5a59
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java b7f8d29
> ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 21c275b
> ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java 056959e
> ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java 75d5fa6
> ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql c2a9239
> ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 48d2c35
> ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql 26201fc
> ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 156fc08
> ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql 979ea44
> ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 08c71ff
>
>
> Diff: https://reviews.apache.org/r/59060/diff/1/
>
>
> Testing
> -------
>
> PENDING
>
>
> Thanks,
>
> Jonathan Hurley
>
>
Re: Review Request 59060: Host Version on Finalization Must Be Scoped
Correctly Based on Upgrade Type
Posted by Jonathan Hurley <jh...@hortonworks.com>.
> On May 9, 2017, 12:24 p.m., Nate Cole wrote:
> > ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
> > Line 244 (original), 244 (patched)
> > <https://reviews.apache.org/r/59060/diff/1/?file=1710754#file1710754line244>
> >
> > Why is state part of the uniqueness? You can't have one host with 2 of the same repo id.
> >
> > can't have:
> > host_version1 -> repo1 'INSTALLED'
> > host_version1 -> repo1 'CURRENT'
> >
> > sure, but uniqueness is satisfied via host_id/repo_id
> > host_version1 -> repo1 'INSTALLED'
> > host_version1 -> repo2 'CURRENT'
Hmmmm - you know, I totally agree and have no clue why I changed this :)
I think my mind thought "CURRENT" is no longer required to be for 1 repo ... but that's a constraint in data not in relationships. I needs to be taken care of in business logic.
- Jonathan
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59060/#review174333
-----------------------------------------------------------
On May 8, 2017, 2:50 p.m., Jonathan Hurley wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59060/
> -----------------------------------------------------------
>
> (Updated May 8, 2017, 2:50 p.m.)
>
>
> Review request for Ambari, Alejandro Fernandez, Dmytro Grinenko, Dmitro Lisnichenko, and Nate Cole.
>
>
> Bugs: AMBARI-20958
> https://issues.apache.org/jira/browse/AMBARI-20958
>
>
> Repository: ambari
>
>
> Description
> -------
>
> The {{host_version}} table must allow for multiple {{CURRENT}} versions. Finalization must be allowed to occur when not all hosts are targeted for upgrade.
>
> During a {{PATCH}} or {{SERVICE}} upgrade, finalization will either fail or be incorrect based on the topology of the cluster. In cases where the upgraded service has components on every host, the {{host_version}} table is moved incorrectly to reflect the stack of the upgraded component.
>
> h6. Topology (HDP 2.4.2.0-236)
> - c6401 - ZooKeeper Server, ZooKeeper Client, Storm Nimbus
> - c6402 - ZooKeeper Server, ZooKeeper Client, Storm Supervisor
> - c6403 - ZooKeeper Server, ZooKeeper Client, Storm Supervisor
>
> h6. {{SERVICE}} upgrade from to HDP-2.5.4.0-121 for {{STORM}} only:
>
> {noformat}
> Begin finalizing the upgrade of cluster c1 to version 2.5.4.0-121
> Finalizing the upgraded state of host components in 3 host(s).
> Finalizing the version for 3 host(s).
> Finalizing the version for cluster c1.
> Creating upgrade history.
> Upgrade was successful!
> {noformat}
>
> {code}
> ambari=# SELECT host_version.host_id, repo_version.version, state FROM host_version, repo_version WHERE host_version.repo_version_id = repo_version.repo_version_id ORDER BY version, host_id;
> host_id | version | state
> ---------+-------------+-----------
> 1 | 2.4.2.0-236 | INSTALLED
> 2 | 2.4.2.0-236 | INSTALLED
> 3 | 2.4.2.0-236 | INSTALLED
> 1 | 2.5.4.0-121 | CURRENT
> 2 | 2.5.4.0-121 | CURRENT
> 3 | 2.5.4.0-121 | CURRENT
> (6 rows)
> {code}
>
> In the event that {{STORM}} is not installed on all hosts, finalization fails:
> h6. Topology (HDP 2.4.2.0-236)
> - c6401 - ZooKeeper Server, ZooKeeper Client, Storm Nimbus
> - c6402 - ZooKeeper Server, ZooKeeper Client, Storm Supervisor
> - c6403 - ZooKeeper Server, ZooKeeper Client
>
> {noformat}
> Begin finalizing the upgrade of cluster c1 to version 2.5.4.0-121
> The following 1 host(s) have not been upgraded to version 2.5.4.0-121. Please install and upgrade the Stack Version on those hosts and try again.
> Hosts: c6403.ambari.apache.org
> {noformat}
>
>
> Diffs
> -----
>
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java fd52a3f
> ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java 33c622f
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ClusterVersionDAO.java 1bcca60
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java 6174912
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostVersionDAO.java 3871b67
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostVersionEntity.java 9be30a3
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java f5d669e
> ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java a4cc757
> ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 88c5a59
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java b7f8d29
> ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 21c275b
> ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java 056959e
> ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java 75d5fa6
> ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql c2a9239
> ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 48d2c35
> ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql 26201fc
> ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 156fc08
> ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql 979ea44
> ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 08c71ff
>
>
> Diff: https://reviews.apache.org/r/59060/diff/1/
>
>
> Testing
> -------
>
> PENDING
>
>
> Thanks,
>
> Jonathan Hurley
>
>
Re: Review Request 59060: Host Version on Finalization Must Be Scoped
Correctly Based on Upgrade Type
Posted by Nate Cole <nc...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59060/#review174333
-----------------------------------------------------------
Fix it, then Ship it!
ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java
Line 112 (original), 104 (patched)
<https://reviews.apache.org/r/59060/#comment247464>
nit: formatting :)
ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
Line 244 (original), 244 (patched)
<https://reviews.apache.org/r/59060/#comment247466>
Why is state part of the uniqueness? You can't have one host with 2 of the same repo id.
can't have:
host_version1 -> repo1 'INSTALLED'
host_version1 -> repo1 'CURRENT'
sure, but uniqueness is satisfied via host_id/repo_id
host_version1 -> repo1 'INSTALLED'
host_version1 -> repo2 'CURRENT'
- Nate Cole
On May 8, 2017, 2:50 p.m., Jonathan Hurley wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59060/
> -----------------------------------------------------------
>
> (Updated May 8, 2017, 2:50 p.m.)
>
>
> Review request for Ambari, Alejandro Fernandez, Dmytro Grinenko, Dmitro Lisnichenko, and Nate Cole.
>
>
> Bugs: AMBARI-20958
> https://issues.apache.org/jira/browse/AMBARI-20958
>
>
> Repository: ambari
>
>
> Description
> -------
>
> The {{host_version}} table must allow for multiple {{CURRENT}} versions. Finalization must be allowed to occur when not all hosts are targeted for upgrade.
>
> During a {{PATCH}} or {{SERVICE}} upgrade, finalization will either fail or be incorrect based on the topology of the cluster. In cases where the upgraded service has components on every host, the {{host_version}} table is moved incorrectly to reflect the stack of the upgraded component.
>
> h6. Topology (HDP 2.4.2.0-236)
> - c6401 - ZooKeeper Server, ZooKeeper Client, Storm Nimbus
> - c6402 - ZooKeeper Server, ZooKeeper Client, Storm Supervisor
> - c6403 - ZooKeeper Server, ZooKeeper Client, Storm Supervisor
>
> h6. {{SERVICE}} upgrade from to HDP-2.5.4.0-121 for {{STORM}} only:
>
> {noformat}
> Begin finalizing the upgrade of cluster c1 to version 2.5.4.0-121
> Finalizing the upgraded state of host components in 3 host(s).
> Finalizing the version for 3 host(s).
> Finalizing the version for cluster c1.
> Creating upgrade history.
> Upgrade was successful!
> {noformat}
>
> {code}
> ambari=# SELECT host_version.host_id, repo_version.version, state FROM host_version, repo_version WHERE host_version.repo_version_id = repo_version.repo_version_id ORDER BY version, host_id;
> host_id | version | state
> ---------+-------------+-----------
> 1 | 2.4.2.0-236 | INSTALLED
> 2 | 2.4.2.0-236 | INSTALLED
> 3 | 2.4.2.0-236 | INSTALLED
> 1 | 2.5.4.0-121 | CURRENT
> 2 | 2.5.4.0-121 | CURRENT
> 3 | 2.5.4.0-121 | CURRENT
> (6 rows)
> {code}
>
> In the event that {{STORM}} is not installed on all hosts, finalization fails:
> h6. Topology (HDP 2.4.2.0-236)
> - c6401 - ZooKeeper Server, ZooKeeper Client, Storm Nimbus
> - c6402 - ZooKeeper Server, ZooKeeper Client, Storm Supervisor
> - c6403 - ZooKeeper Server, ZooKeeper Client
>
> {noformat}
> Begin finalizing the upgrade of cluster c1 to version 2.5.4.0-121
> The following 1 host(s) have not been upgraded to version 2.5.4.0-121. Please install and upgrade the Stack Version on those hosts and try again.
> Hosts: c6403.ambari.apache.org
> {noformat}
>
>
> Diffs
> -----
>
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java fd52a3f
> ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java 33c622f
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ClusterVersionDAO.java 1bcca60
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java 6174912
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostVersionDAO.java 3871b67
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostVersionEntity.java 9be30a3
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java f5d669e
> ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java a4cc757
> ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 88c5a59
> ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java b7f8d29
> ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 21c275b
> ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java 056959e
> ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java 75d5fa6
> ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql c2a9239
> ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 48d2c35
> ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql 26201fc
> ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 156fc08
> ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql 979ea44
> ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 08c71ff
>
>
> Diff: https://reviews.apache.org/r/59060/diff/1/
>
>
> Testing
> -------
>
> PENDING
>
>
> Thanks,
>
> Jonathan Hurley
>
>
Re: Review Request 59060: Host Version on Finalization Must Be Scoped
Correctly Based on Upgrade Type
Posted by Jonathan Hurley <jh...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59060/
-----------------------------------------------------------
(Updated May 9, 2017, 1:04 p.m.)
Review request for Ambari, Alejandro Fernandez, Dmytro Grinenko, Dmitro Lisnichenko, and Nate Cole.
Bugs: AMBARI-20958
https://issues.apache.org/jira/browse/AMBARI-20958
Repository: ambari
Description
-------
The {{host_version}} table must allow for multiple {{CURRENT}} versions. Finalization must be allowed to occur when not all hosts are targeted for upgrade.
During a {{PATCH}} or {{SERVICE}} upgrade, finalization will either fail or be incorrect based on the topology of the cluster. In cases where the upgraded service has components on every host, the {{host_version}} table is moved incorrectly to reflect the stack of the upgraded component.
h6. Topology (HDP 2.4.2.0-236)
- c6401 - ZooKeeper Server, ZooKeeper Client, Storm Nimbus
- c6402 - ZooKeeper Server, ZooKeeper Client, Storm Supervisor
- c6403 - ZooKeeper Server, ZooKeeper Client, Storm Supervisor
h6. {{SERVICE}} upgrade from to HDP-2.5.4.0-121 for {{STORM}} only:
{noformat}
Begin finalizing the upgrade of cluster c1 to version 2.5.4.0-121
Finalizing the upgraded state of host components in 3 host(s).
Finalizing the version for 3 host(s).
Finalizing the version for cluster c1.
Creating upgrade history.
Upgrade was successful!
{noformat}
{code}
ambari=# SELECT host_version.host_id, repo_version.version, state FROM host_version, repo_version WHERE host_version.repo_version_id = repo_version.repo_version_id ORDER BY version, host_id;
host_id | version | state
---------+-------------+-----------
1 | 2.4.2.0-236 | INSTALLED
2 | 2.4.2.0-236 | INSTALLED
3 | 2.4.2.0-236 | INSTALLED
1 | 2.5.4.0-121 | CURRENT
2 | 2.5.4.0-121 | CURRENT
3 | 2.5.4.0-121 | CURRENT
(6 rows)
{code}
In the event that {{STORM}} is not installed on all hosts, finalization fails:
h6. Topology (HDP 2.4.2.0-236)
- c6401 - ZooKeeper Server, ZooKeeper Client, Storm Nimbus
- c6402 - ZooKeeper Server, ZooKeeper Client, Storm Supervisor
- c6403 - ZooKeeper Server, ZooKeeper Client
{noformat}
Begin finalizing the upgrade of cluster c1 to version 2.5.4.0-121
The following 1 host(s) have not been upgraded to version 2.5.4.0-121. Please install and upgrade the Stack Version on those hosts and try again.
Hosts: c6403.ambari.apache.org
{noformat}
Diffs (updated)
-----
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java fd52a3f
ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java 33c622f
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ClusterVersionDAO.java 1bcca60
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java 6174912
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostVersionDAO.java 3871b67
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostVersionEntity.java 9be30a3
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RepositoryVersionEntity.java f5d669e
ambari-server/src/main/java/org/apache/ambari/server/serveraction/ServerActionExecutor.java 68124fc
ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java a4cc757
ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/UpdateDesiredStackAction.java 22f2e73
ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 88c5a59
ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java b7f8d29
ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContext.java f1bd900
ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 21c275b
ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java 056959e
ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostSummary.java 75d5fa6
ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql c2a9239
ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 48d2c35
ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql 26201fc
ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 156fc08
ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql 979ea44
ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 08c71ff
ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListenerTest.java d5b2d46
ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java 6471988
Diff: https://reviews.apache.org/r/59060/diff/2/
Changes: https://reviews.apache.org/r/59060/diff/1-2/
Testing (updated)
-------
Cluster deploy, upgrade/downgrade. The existing failures in this branch were the only test failures.
Thanks,
Jonathan Hurley