> On May 1, 2017, 6:59 p.m., Alejandro Fernandez wrote: > > ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ViewInstanceDAO.java > > Lines 186 (patched) > > <https://reviews.apache.org/r/58886/diff/1/?file=1704053#file1704053line186> > > > > Why does the cluster ID change? > > If that's the root cause, we should fix that instead.
So I think if the cluster install fails because of some reason. A reattempt from UI is done and at that time the cluster id is changed. But this change is not propogated to ViewRegistry and it does not delete already created auto view instances or changes their cluster id. Yes this solution is not elegant. Although this bug is rare but when it comes it creates problems even in correcting the views from the UI. And so the severity of the bug is high. I think a better solution would be to fire one event like "ClusterDeleted" which will be picked up by ViewRegistry and it will delete the views which were created for that cluster id. Auto instances will again get created with new cluster id. This solution might take more time to implement as it touches more surface. We will log another bug for this change. But the current patch handles the sitution and keeps ambari and views properly running. - Nitiraj ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/58886/#review173490 ----------------------------------------------------------- On May 1, 2017, 6:57 p.m., Nitiraj Rathore wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/58886/ > ----------------------------------------------------------- > > (Updated May 1, 2017, 6:57 p.m.) > > > Review request for Ambari, DIPAYAN BHOWMICK, Gaurav Nagar, Pallav > Kulshreshtha, Rohit Choudhary, venkat sairam, and Ashwin Rajeev. > > > Bugs: AMBARI-20905 > https://issues.apache.org/jira/browse/AMBARI-20905 > > > Repository: ambari > > > Description > ------- > > If installation fails and is retried the cluster id changes but some view > instances keep older cluster ids which stop views from being displayed later > on. > remove the view instances which contains invalid cluster id before creating > any autoview instance. > > > Diffs > ----- > > > ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ViewInstanceDAO.java > 061c7223d6 > > ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ViewInstanceEntity.java > b632c54043 > ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java > 24eceb21c6 > > ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariPrivilegeResourceProviderTest.java > 25afe92ce4 > > ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ViewPrivilegeResourceProviderTest.java > 8836af6ead > > ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java > a3728d46b3 > > > Diff: https://reviews.apache.org/r/58886/diff/1/ > > > Testing > ------- > > updated testcases where ever needed. Manual testing also done. > > > Thanks, > > Nitiraj Rathore > >