-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/22480/
-----------------------------------------------------------
Review request for Ambari, Mahadev Konar and Sumit Mohanty.
Bugs: AMBARI-6090
https://issues.apache.org/jira/browse/AMBARI-6090
Repository: ambari
Description
-------
Upgrading from 1.4.x to 1.6.1 fails on the 1.6.0 schema upgrade. The
restart_required column is defined in Postgres as a boolean, but in other
database as a SMALLINT. The upgrade code was attempting to use an integer value
of 0 when upgrading on Postgres. Casting from an boolean to a numeric is not
allowed at the database level, and thus the error.
I notice that we go to great lengths in our code to avoid using boolean types
in the database; this is actually the first instance of one. Normally, I would
have just changed this field back to a SMALLINT to be consistent. However,
since 1.6.0 has shipped, that means that we'd need to alter the column type on
upgrades. The added code complexity was not worth it, so instead I fixed the
problem with the boolean on postgres.
Diffs
-----
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog160.java
51b6e0b
ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog160Test.java
00dbbf8
Diff: https://reviews.apache.org/r/22480/diff/
Testing
-------
Modified existing tests to account for the changes and added a new test just
for Postgres.
[INFO] Reactor Summary:
[INFO]
[INFO] Ambari Main ....................................... SUCCESS [1.798s]
[INFO] Apache Ambari Project POM ......................... SUCCESS [0.215s]
[INFO] Ambari Web ........................................ SUCCESS [8.969s]
[INFO] Ambari Views ...................................... SUCCESS [1.189s]
[INFO] Ambari Server ..................................... SUCCESS [12:57.787s]
[INFO] Ambari Agent ...................................... SUCCESS [4.643s]
[INFO] Ambari Client ..................................... SUCCESS [0.030s]
[INFO] Ambari Python Client .............................. SUCCESS [0.263s]
[INFO] Ambari Groovy Client .............................. SUCCESS [2.790s]
[INFO] Ambari Shell ...................................... SUCCESS [4.208s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13:22.329s
[INFO] Finished at: Wed Jun 11 23:40:21 EDT 2014
[INFO] Final Memory: 31M/123M
[INFO] ------------------------------------------------------------------------
Thanks,
Jonathan Hurley