----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/53686/#review156009 -----------------------------------------------------------
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostRoleCommandEntity.java (lines 262 - 264) <https://reviews.apache.org/r/53686/#comment226090> This line is concerned - how would stage be null? If it was, then the actual parent stage wouldn't have it's status updated. ambari-server/src/main/java/org/apache/ambari/server/orm/entities/StageEntity.java (line 227) <https://reviews.apache.org/r/53686/#comment226094> I think this is where the biggest problem is. There's a reason that HRC and Stage collections are lazily fetched - it's because it doesn't come from JPA cache since it's an M2M entity relationship. It comes from the DB every time. This kind of call would destroy large, long-running orchestrations like upgrades. ambari-server/src/main/java/org/apache/ambari/server/orm/entities/StageEntity.java (lines 231 - 237) <https://reviews.apache.org/r/53686/#comment226091> This method isn't used externally - can we make it private or just integrate it directly into updateStatus() ? Otherwise it's possible to recalculate the request independant of setting the stage's status which seems wrong. ambari-server/src/main/java/org/apache/ambari/server/orm/entities/StageEntity.java (lines 232 - 237) <https://reviews.apache.org/r/53686/#comment226093> NPE here? Isn't it impossible for a stage not to have a request? That would violate the DB. ambari-server/src/main/java/org/apache/ambari/server/orm/entities/StatusHoldingEntity.java (lines 23 - 27) <https://reviews.apache.org/r/53686/#comment226092> Documentation. - Jonathan Hurley On Nov. 14, 2016, 9:54 p.m., Jaimin Jetly wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/53686/ > ----------------------------------------------------------- > > (Updated Nov. 14, 2016, 9:54 p.m.) > > > Review request for Ambari, Jonathan Hurley, Nate Cole, and Sid Wagle. > > > Bugs: AMBARI-18868 > https://issues.apache.org/jira/browse/AMBARI-18868 > > > Repository: ambari > > > Description > ------- > > Stage and Request status should be persisted in the database. > > upgrading to ambari-3.0.0 should add status for all present stages and > request for the cluster. > > > Diffs > ----- > > > ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java > 2c87583 > > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java > 3a86aef > > ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostRoleCommandEntity.java > 74271b9 > > ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RequestEntity.java > b1aad00 > > ambari-server/src/main/java/org/apache/ambari/server/orm/entities/StageEntity.java > f9c8810 > > ambari-server/src/main/java/org/apache/ambari/server/orm/entities/StatusHoldingEntity.java > PRE-CREATION > > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java > 4f90ef3 > ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql 8cf2c0d > ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 37a9757 > ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql 15d6120 > ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 5a82a52 > ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql 659e4dc > ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql e9a258a > > ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionDBAccessorImpl.java > 1ca777d > > ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java > 14e3d08 > > ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeSummaryResourceProviderTest.java > baec7df > > ambari-server/src/test/java/org/apache/ambari/server/orm/dao/UpgradeDAOTest.java > cc49cbd > > ambari-server/src/test/java/org/apache/ambari/server/state/services/RetryUpgradeActionServiceTest.java > 2fb57d7 > > ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java > d7979e8 > > Diff: https://reviews.apache.org/r/53686/diff/ > > > Testing > ------- > > Verified manually on a cluster by making api requests and upgrading ambari. > Add unit tests. > Jenkins job overall unit test result pending.. > > > Thanks, > > Jaimin Jetly > >
