----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/74301/ -----------------------------------------------------------
Review request for ranger and Pradeep Agrawal. Repository: ranger Description ------- XXPolicyRef objects have fields such as create time, update time, added by user ID, updated by user ID, but there fields are entirely useless since they are all copied from the XXPolicy object. In addition, while improving performance for creation of policies with large numbers of users, we discovered that a lot of time was being spent in JPA converting these Date objects especially. After removing these fields we saw a significant performance improvement (a secondary benefit is less database space usage). We previously tried this commit and it caused a few issues (some typos on SQL Server and SQL Anywhere, as well as upgrade scenarios - however this has been fixed). Diffs ----- security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql 9a79fe8ad security-admin/db/mysql/patches/061-drop-audit-columns-from-policy-ref-tables.sql PRE-CREATION security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql fd6cec9a7 security-admin/db/oracle/patches/061-drop-audit-columns-from-policy-ref-tables.sql PRE-CREATION security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql 4d5a8cedf security-admin/db/postgres/patches/061-drop-audit-columns-from-policy-ref-tables.sql PRE-CREATION security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql 3ed2a5b9c security-admin/db/sqlanywhere/patches/061-drop-audit-columns-from-policy-ref-tables.sql PRE-CREATION security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql ca8f7da1f security-admin/db/sqlserver/patches/061-drop-audit-columns-from-policy-ref-tables.sql PRE-CREATION security-admin/src/main/java/org/apache/ranger/biz/PolicyRefUpdater.java 6cc3509d8 security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefAccessType.java 6af8f99f4 security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefCondition.java 4f4409d6a security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefDataMaskType.java cb926740e security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefGroup.java 32a1b9f24 security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefResource.java 115064621 security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefRole.java 7aee502e0 security-admin/src/main/java/org/apache/ranger/entity/XXPolicyRefUser.java 8dfb92833 security-admin/src/main/java/org/apache/ranger/service/XPortalUserService.java 85e457efa security-admin/src/test/java/org/apache/ranger/biz/TestServiceDBStore.java 691ab52b3 Diff: https://reviews.apache.org/r/74301/diff/1/ Testing ------- Fresh install and upgrade tested on all 5 databases (tested service and policy creation) Also tested user deletion on MySQL: 1. Created new user 2. Logged in as new user, created a policy 3. Logged back in as original user, delete user that created policy 4. Verified no errors, policy is still present/correct Also searched the source code and JPA queries xml for other references to these fields Thanks, Andrew Luo
