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 2016/02/03 01:17:33 UTC

Review Request 43123: RU/EU should only delete configs on downgrade if source stack matches stack whose status is CURRENT

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

Review request for Ambari, Dmytro Grinenko, Dmitro Lisnichenko, Jonathan Hurley, Nate Cole, and Swapan Shridhar.


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


Repository: ambari


Description
-------

Saw a case with a customer in which they did the following.

* Ambari 2.1.2
* Rolling Upgrade from HDP 2.2 to 2.3.0.0 and skipped the Finalize step, so Ambari never called "Save DB State". Hence, the current stack version was still 2.2. They then modified the host_version and cluster_version records in the DB to mark HDP 2.3 as CURRENT.
* Forgot to call ambari-server set-current-version
* Registered and installed bits for HDP 2.3.4.0 and began another RU. After running into an issue, they decided to downgrade, which then completely removed the configs for the target stack (which is HDP 2.3!)

In order to prevent deleting configs in cases where the user has modified the database, add stronger validation to FinalizeUpgradeAction so that we check that the request's source target stack equals the stack of the repo marked as CURRENT. In this case, they were 2.2 and 2.3, respectively.


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java 9331ef0 
  ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java b6bc82e 

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


Testing
-------

Ran unit tests in UpgradeActionTest.java and verified on a live cluster


Thanks,

Alejandro Fernandez


Re: Review Request 43123: RU/EU should only delete configs on downgrade if source stack matches stack whose status is CURRENT

Posted by Dmitro Lisnichenko <dl...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43123/#review117603
-----------------------------------------------------------


Ship it!




Ship It!

- Dmitro Lisnichenko


On Feb. 3, 2016, 2:25 a.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43123/
> -----------------------------------------------------------
> 
> (Updated Feb. 3, 2016, 2:25 a.m.)
> 
> 
> Review request for Ambari, Dmytro Grinenko, Dmitro Lisnichenko, Jonathan Hurley, Nate Cole, and Swapan Shridhar.
> 
> 
> Bugs: AMBARI-14891
>     https://issues.apache.org/jira/browse/AMBARI-14891
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Saw a case with a customer in which they did the following.
> 
> * Ambari 2.1.2
> * Rolling Upgrade from HDP 2.2 to 2.3.0.0 and skipped the Finalize step, so Ambari never called "Save DB State". Hence, the current stack version was still 2.2. They then modified the host_version and cluster_version records in the DB to mark HDP 2.3 as CURRENT.
> * Forgot to call ambari-server set-current-version
> * Registered and installed bits for HDP 2.3.4.0 and began another RU. After running into an issue, they decided to downgrade, which then completely removed the configs for the target stack (which is HDP 2.3!)
> 
> In order to prevent deleting configs in cases where the user has modified the database, add stronger validation to FinalizeUpgradeAction so that we check that the request's source target stack equals the stack of the repo marked as CURRENT. In this case, they were 2.2 and 2.3, respectively.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java 9331ef0 
>   ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java b6bc82e 
> 
> Diff: https://reviews.apache.org/r/43123/diff/
> 
> 
> Testing
> -------
> 
> Ran unit tests in UpgradeActionTest.java and verified on a live cluster
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


Re: Review Request 43123: RU/EU should only delete configs on downgrade if source stack matches stack whose status is CURRENT

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

> On Feb. 3, 2016, 1:34 p.m., Nate Cole wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java, lines 321-323
> > <https://reviews.apache.org/r/43123/diff/2/?file=1230230#file1230230line321>
> >
> >     You're formatting with a mix of text here and a constant.  Would make it a bit easier to follow to make it all a constant format string.

The unit test does an assertion that the message contains the constant.


- Alejandro


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


On Feb. 3, 2016, 12:25 a.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43123/
> -----------------------------------------------------------
> 
> (Updated Feb. 3, 2016, 12:25 a.m.)
> 
> 
> Review request for Ambari, Dmytro Grinenko, Dmitro Lisnichenko, Jonathan Hurley, Nate Cole, and Swapan Shridhar.
> 
> 
> Bugs: AMBARI-14891
>     https://issues.apache.org/jira/browse/AMBARI-14891
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Saw a case with a customer in which they did the following.
> 
> * Ambari 2.1.2
> * Rolling Upgrade from HDP 2.2 to 2.3.0.0 and skipped the Finalize step, so Ambari never called "Save DB State". Hence, the current stack version was still 2.2. They then modified the host_version and cluster_version records in the DB to mark HDP 2.3 as CURRENT.
> * Forgot to call ambari-server set-current-version
> * Registered and installed bits for HDP 2.3.4.0 and began another RU. After running into an issue, they decided to downgrade, which then completely removed the configs for the target stack (which is HDP 2.3!)
> 
> In order to prevent deleting configs in cases where the user has modified the database, add stronger validation to FinalizeUpgradeAction so that we check that the request's source target stack equals the stack of the repo marked as CURRENT. In this case, they were 2.2 and 2.3, respectively.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java 9331ef0 
>   ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java b6bc82e 
> 
> Diff: https://reviews.apache.org/r/43123/diff/
> 
> 
> Testing
> -------
> 
> Ran unit tests in UpgradeActionTest.java and verified on a live cluster
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


Re: Review Request 43123: RU/EU should only delete configs on downgrade if source stack matches stack whose status is CURRENT

Posted by Nate Cole <nc...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43123/#review117612
-----------------------------------------------------------


Ship it!





ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java (lines 321 - 323)
<https://reviews.apache.org/r/43123/#comment178857>

    You're formatting with a mix of text here and a constant.  Would make it a bit easier to follow to make it all a constant format string.


- Nate Cole


On Feb. 2, 2016, 7:25 p.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43123/
> -----------------------------------------------------------
> 
> (Updated Feb. 2, 2016, 7:25 p.m.)
> 
> 
> Review request for Ambari, Dmytro Grinenko, Dmitro Lisnichenko, Jonathan Hurley, Nate Cole, and Swapan Shridhar.
> 
> 
> Bugs: AMBARI-14891
>     https://issues.apache.org/jira/browse/AMBARI-14891
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Saw a case with a customer in which they did the following.
> 
> * Ambari 2.1.2
> * Rolling Upgrade from HDP 2.2 to 2.3.0.0 and skipped the Finalize step, so Ambari never called "Save DB State". Hence, the current stack version was still 2.2. They then modified the host_version and cluster_version records in the DB to mark HDP 2.3 as CURRENT.
> * Forgot to call ambari-server set-current-version
> * Registered and installed bits for HDP 2.3.4.0 and began another RU. After running into an issue, they decided to downgrade, which then completely removed the configs for the target stack (which is HDP 2.3!)
> 
> In order to prevent deleting configs in cases where the user has modified the database, add stronger validation to FinalizeUpgradeAction so that we check that the request's source target stack equals the stack of the repo marked as CURRENT. In this case, they were 2.2 and 2.3, respectively.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java 9331ef0 
>   ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java b6bc82e 
> 
> Diff: https://reviews.apache.org/r/43123/diff/
> 
> 
> Testing
> -------
> 
> Ran unit tests in UpgradeActionTest.java and verified on a live cluster
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


Re: Review Request 43123: RU/EU should only delete configs on downgrade if source stack matches stack whose status is CURRENT

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


Ship it!




Ship It!

- Jonathan Hurley


On Feb. 2, 2016, 7:25 p.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43123/
> -----------------------------------------------------------
> 
> (Updated Feb. 2, 2016, 7:25 p.m.)
> 
> 
> Review request for Ambari, Dmytro Grinenko, Dmitro Lisnichenko, Jonathan Hurley, Nate Cole, and Swapan Shridhar.
> 
> 
> Bugs: AMBARI-14891
>     https://issues.apache.org/jira/browse/AMBARI-14891
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Saw a case with a customer in which they did the following.
> 
> * Ambari 2.1.2
> * Rolling Upgrade from HDP 2.2 to 2.3.0.0 and skipped the Finalize step, so Ambari never called "Save DB State". Hence, the current stack version was still 2.2. They then modified the host_version and cluster_version records in the DB to mark HDP 2.3 as CURRENT.
> * Forgot to call ambari-server set-current-version
> * Registered and installed bits for HDP 2.3.4.0 and began another RU. After running into an issue, they decided to downgrade, which then completely removed the configs for the target stack (which is HDP 2.3!)
> 
> In order to prevent deleting configs in cases where the user has modified the database, add stronger validation to FinalizeUpgradeAction so that we check that the request's source target stack equals the stack of the repo marked as CURRENT. In this case, they were 2.2 and 2.3, respectively.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java 9331ef0 
>   ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java b6bc82e 
> 
> Diff: https://reviews.apache.org/r/43123/diff/
> 
> 
> Testing
> -------
> 
> Ran unit tests in UpgradeActionTest.java and verified on a live cluster
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>


Re: Review Request 43123: RU/EU should only delete configs on downgrade if source stack matches stack whose status is CURRENT

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

(Updated Feb. 3, 2016, 12:25 a.m.)


Review request for Ambari, Dmytro Grinenko, Dmitro Lisnichenko, Jonathan Hurley, Nate Cole, and Swapan Shridhar.


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


Repository: ambari


Description
-------

Saw a case with a customer in which they did the following.

* Ambari 2.1.2
* Rolling Upgrade from HDP 2.2 to 2.3.0.0 and skipped the Finalize step, so Ambari never called "Save DB State". Hence, the current stack version was still 2.2. They then modified the host_version and cluster_version records in the DB to mark HDP 2.3 as CURRENT.
* Forgot to call ambari-server set-current-version
* Registered and installed bits for HDP 2.3.4.0 and began another RU. After running into an issue, they decided to downgrade, which then completely removed the configs for the target stack (which is HDP 2.3!)

In order to prevent deleting configs in cases where the user has modified the database, add stronger validation to FinalizeUpgradeAction so that we check that the request's source target stack equals the stack of the repo marked as CURRENT. In this case, they were 2.2 and 2.3, respectively.


Diffs (updated)
-----

  ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java 9331ef0 
  ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java b6bc82e 

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


Testing
-------

Ran unit tests in UpgradeActionTest.java and verified on a live cluster


Thanks,

Alejandro Fernandez