> On Сер. 23, 2017, 6:59 після полудня, Sid Wagle wrote: > > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java > > Lines 160 (patched) > > <https://reviews.apache.org/r/61856/diff/1/?file=1802391#file1802391line163> > > > > Why doesn't this check is service exists or not?
I think that this query will be enough: "SELECT clusterConfig FROM ClusterConfigEntity clusterConfig WHERE clusterConfig.serviceConfigEntities IS EMPTY AND clusterConfig.type != 'cluster-env'". Using it we will get all configs from clusterconfig table, which are not linked ti any service config. I think it's safe. Anyway we are using same query in db consistency check and they will be removed according to auto fix. One more, if we will just check configs without service, there are some cases which will not be covered. Like this one (for example): 1) Deploy cluster with hbase 2) Remove hbase. Configs will stay. 3) Add hbase. Old configs will become orphaned, and hbase will create and use new one. So, to my mind query that i used is correct/safe and will cover all needed cases. > On Сер. 23, 2017, 6:59 після полудня, Sid Wagle wrote: > > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java > > Lines 168 (patched) > > <https://reviews.apache.org/r/61856/diff/1/?file=1802391#file1802391line171> > > > > Is this within a transaction boundary? Sorry, missed that. Done. > On Сер. 23, 2017, 6:59 після полудня, Sid Wagle wrote: > > ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog260Test.java > > Lines 48 (patched) > > <https://reviews.apache.org/r/61856/diff/1/?file=1802401#file1802401line54> > > > > Make sure to run checkstyle on this. done. - Vitalyi ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/61856/#review183641 ----------------------------------------------------------- On Сер. 23, 2017, 9:14 після полудня, Vitalyi Brodetskyi wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/61856/ > ----------------------------------------------------------- > > (Updated Сер. 23, 2017, 9:14 після полудня) > > > Review request for Ambari, Myroslav Papirkovskyy and Sid Wagle. > > > Bugs: AMBARI-21795 > https://issues.apache.org/jira/browse/AMBARI-21795 > > > Repository: ambari > > > Description > ------- > > If user has deleted services, after upgrade db consistency check will throw > warnings about unmapped configs. > > > Diffs > ----- > > > ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java > 40049c0 > > ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigEntity.java > 34f3034 > ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java > 319bf53 > > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java > 7fc392d > ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql 9cdf8e8 > ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql d616e77 > ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql 0530651 > ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 1d16eb6 > ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql da23e95 > ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql e410555 > > ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog260Test.java > 44b5d91 > > > Diff: https://reviews.apache.org/r/61856/diff/3/ > > > Testing > ------- > > mvn clean test > > > Thanks, > > Vitalyi Brodetskyi > >
