> On April 8, 2016, 12:26 p.m., Jonathan Hurley wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java,
> >  lines 687-692
> > <https://reviews.apache.org/r/45904/diff/2/?file=1331569#file1331569line687>
> >
> >     This is a very dangerous query. This can literally return 10,000 
> > entries.
> 
> Sid Wagle wrote:
>     Thanks for pointing that out, I will explore an explicit join query as a 
> workaround to offload it back to the DB.
>     For the issue regarding reccurence of this situation I suggested adding 
> gtid enforce policy in the system tests for the use case of delete cluster, 
> etc.

Modified to reading ids only.


- Sid


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


On April 8, 2016, 8:56 p.m., Sid Wagle wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45904/
> -----------------------------------------------------------
> 
> (Updated April 8, 2016, 8:56 p.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Myroslav Papirkovskyy, and Sumit 
> Mohanty.
> 
> 
> Bugs: AMBARI-15774
>     https://issues.apache.org/jira/browse/AMBARI-15774
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Approach:
> 
> - Added member varaibles only when underlying DB columns exist
> - Changed DELETE via implcit join query to find and delete
> - MySQL temp tables are only used for UPDATE ALL and DELETE ALL, so SELECT 
> and DELETE is a safer approach
> - Visually inspected all Entities under 
> org.apache.ambari.server.orm.entities.* for absence of this pattern
> 
> Issue: Ambari upgrade is failing from 2.2.0 to 2.2.1.1 with below error:
> 
> Error output from schema upgrade command: 
> Exception in thread "main" org.apache.ambari.server.AmbariException: 
> Exception [EclipseLink-4002] (Eclipse Persistence Services - 
> 2.5.2.v20140319-9ad6abd): 
> org.eclipse.persistence.exceptions.DatabaseException 
> Internal Exception: 
> com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 
> 'ambari.TL_alert_notice' doesn't exist 
> Error Code: 1146
> 
> 
> Diffs
> -----
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertReceivedListener.java
>  a3befa6 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAO.java
>  82fa48a 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java
>  1f1aa45 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java 
> 781d4cf 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertCurrentEntity.java
>  604b00e 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertHistoryEntity.java
>  03ffcde 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertNoticeEntity.java
>  ae7495d 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertResourceProviderTest.java
>  d611fe8 
>   
> ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAOTest.java
>  36e75e7 
>   
> ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertsDAOTest.java
>  10f099e 
> 
> Diff: https://reviews.apache.org/r/45904/diff/
> 
> 
> Testing
> -------
> 
> Manually verified on 1 node repro cluster.
> 
> All alert unit test passed.
> 
> mvn clean test -Dtest=Alert* -Drat.ignoreErrors -DfailIfNoTests=false
> 
> 
> Thanks,
> 
> Sid Wagle
> 
>

Reply via email to