> On 二月 24, 2023, 2:47 a.m., Madhan Neethiraj wrote: > > security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql > > Line 856 (original) > > <https://reviews.apache.org/r/74319/diff/1/?file=2274750#file2274750line858> > > > > This patch deletes around 20 tables, but corresponding entity/dao > > classes have not been deleted. Deleting these classes might be involved; > > until this is done, I suggest to not to delete the tables. > > > > This can help to enable rolling upgrades as well i.e. current version > > of Ranger will continue to work with newer version of Ranger. This will > > however require: > > - the newer Ranger to continue populating tables used current version > > as well, in addition to new column x_service_def.service_def_text > > - in addition, the newer Ranger should handle service_def updates from > > earlier Ranger version - perhaps by having another column like > > update_time_v2 and comparing it to update_time column
It is very compliated to rollback. I suggest renaming these obsolete tables instead of deleting them to avoid possible conflicts and keep backups. - Kirby ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/74319/#review225214 ----------------------------------------------------------- On 二月 23, 2023, 10:35 p.m., Abhay Kulkarni wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/74319/ > ----------------------------------------------------------- > > (Updated 二月 23, 2023, 10:35 p.m.) > > > Review request for ranger, Abhishek Kumar, Dineshkumar Yadav, madhan, Madhan > Neethiraj, Pradeep Agrawal, and Velmurugan Periasamy. > > > Bugs: RANGER-4108 > https://issues.apache.org/jira/browse/RANGER-4108 > > > Repository: ranger > > > Description > ------- > > Currently, Service Definitions are persisted in several database tables in a > normalized form. However, as operations on a Service Definition object is not > granular, but act on the object as a whole, there is not much advantage in > normalizing it for storage, and a distinct disadvantage of having to recreate > it by accessing multiple database tables during the initialization of Ranger > admin process. > > This Jira denormalizes service-definition object's persistent state and also > removes several tables used only for normalizing service-definition object. > > > Diffs > ----- > > > agents-common/src/main/java/org/apache/ranger/plugin/store/AbstractServiceStore.java > 8632dd6bc > security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql > 9a79fe8ad > security-admin/db/mysql/patches/061-update-schema-for-x-service-def.sql > PRE-CREATION > security-admin/db/mysql/patches/062-remove-unused-ranger-tables-v1.sql > PRE-CREATION > security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql > fd6cec9a7 > security-admin/db/oracle/patches/061-update-schema-for-x-service-def.sql > PRE-CREATION > security-admin/db/oracle/patches/062-remove-unused-ranger-tables-v1.sql > PRE-CREATION > security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql > 4d5a8cedf > security-admin/db/postgres/patches/061-update-schema-for-x-service-def.sql > PRE-CREATION > security-admin/db/postgres/patches/062-remove-unused-ranger-tables-v1.sql > PRE-CREATION > > security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql > 3ed2a5b9c > > security-admin/db/sqlanywhere/patches/061-update-schema-for-x-service-def.sql > PRE-CREATION > > security-admin/db/sqlanywhere/patches/062-remove-unused-ranger-tables-v1.sql > PRE-CREATION > security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql > ca8f7da1f > security-admin/db/sqlserver/patches/059-update-x-portal-user-table.sql > 0e5388646 > security-admin/db/sqlserver/patches/061-update-schema-for-x-service-def.sql > PRE-CREATION > security-admin/db/sqlserver/patches/062-remove-unused-ranger-tables-v1.sql > PRE-CREATION > security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java > 562467e80 > security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java bbbf90c52 > security-admin/src/main/java/org/apache/ranger/common/db/BaseDao.java > 418557bcb > security-admin/src/main/java/org/apache/ranger/entity/XXAccessTypeDef.java > db1878a35 > security-admin/src/main/java/org/apache/ranger/entity/XXServiceDefBase.java > 7f8d6193f > > security-admin/src/main/java/org/apache/ranger/patch/PatchForRemovalOfUnusedRangerDbTables_J10059.java > PRE-CREATION > > security-admin/src/main/java/org/apache/ranger/patch/PatchForSolrSvcDefAndPoliciesUpdate_J10055.java > f5f9f8956 > > security-admin/src/main/java/org/apache/ranger/patch/PatchForUpdatingServiceDefJson_J10058.java > PRE-CREATION > > security-admin/src/main/java/org/apache/ranger/patch/PatchPreSql_058_ForUpdateToUniqueResoureceSignature_J10053.java > fb7e5fd40 > > security-admin/src/main/java/org/apache/ranger/service/RangerServiceDefServiceBase.java > 656bc0184 > > security-admin/src/main/java/org/apache/ranger/service/XPortalUserService.java > 85e457efa > security-admin/src/test/java/org/apache/ranger/biz/TestServiceDBStore.java > 691ab52b3 > security-admin/src/test/java/org/apache/ranger/biz/TestXUserMgr.java > 528f4e511 > > > Diff: https://reviews.apache.org/r/74319/diff/1/ > > > Testing > ------- > > Ran all unit tests successfully. Ran ranger-admin and component services in a > cluster and verified they work correctly. > > > Thanks, > > Abhay Kulkarni > >