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


Ship it!




Ship It!

- Sid Wagle


On Aug. 7, 2016, 8:10 p.m., Jonathan Hurley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50881/
> -----------------------------------------------------------
> 
> (Updated Aug. 7, 2016, 8:10 p.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Robert Levas, and Robert 
> Nettleton.
> 
> 
> Bugs: AMBARI-18057
>     https://issues.apache.org/jira/browse/AMBARI-18057
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Noticed the following on an upgraded cluster:
> This is not related to EU it seems:
> 
> ```
> java.lang.NullPointerException
>         at 
> org.apache.ambari.server.controller.internal.AlertResourceProvider.toResource(AlertResourceProvider.java:277)
>         at 
> org.apache.ambari.server.controller.internal.AlertResourceProvider.getResources(AlertResourceProvider.java:234)
>         at 
> org.apache.ambari.server.controller.internal.AlertResourceProvider.queryForResources(AlertResourceProvider.java:160)
> ```
> 
> It looks like this is a problem with database consistency, namely that our 
> upgrade logic does NOT properly enforce non-null and default values!
> ```
> //TODO workaround for default values, possibly we will have full support later
> if (columnInfo.getDefaultValue() != null) {
>   columnInfo.setNullable(true);
>       }
> ```
> 
> Turns out we're doing at least 2 things very wrong here when changing the DB 
> on Ambari upgrade:
> - Not enforcing non-NULL constraint on columns
> - Not enforcing a default constraint on column
> 
> This is most likely due to limitations in EclipseLink's {{TableDefinition}} 
> and {{FieldDefinition}} classes which we rely on for our upgrade logic.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessor.java 
> 5f126f6 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java 
> ea5f496 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertCurrentEntity.java
>  77f5acc 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/DbmsHelper.java
>  30c06fb 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/GenericDbmsHelper.java
>  21fa361 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/OracleHelper.java
>  88ef8fe 
>   
> ambari-server/src/test/java/org/apache/ambari/server/orm/DBAccessorImplTest.java
>  ac8bea1 
> 
> Diff: https://reviews.apache.org/r/50881/diff/
> 
> 
> Testing
> -------
> 
> Tested an upgrade from Ambari 2.2 / HDP 2.3 to Ambari 2.4.0 on:
> - MySQL
> - Postgres
> - Oracle
> 
> Still working on SQL Server, but figure I'd get the review up while I was 
> setting up yet another environment.
> 
> 
> Thanks,
> 
> Jonathan Hurley
> 
>

Reply via email to