Affects Version/s: 6.2.X EE, 7.0.0 DXP SP2, Master
The BaseUpgradePortletId.upgradeResourcePermission process is inefficient. This is bad because this method gets called a lot during an upgrade to Liferay 7.
Steps to Reproduce
- Start up a fresh instance of Liferay 6.2 and log in as the admin user.
- Navigate to Control Panel > Configuration > Server Administration > Script
- Change the Language to Groovy and paste the contents of the attached addManyRolesAndMediaGalleryPermissions.groovy script into the Script box.
- Press the Execute button. This will cause a Media Gallery portlet to be added to the home page, and 500000 new roles to be created, each with their own resource permission for the Media Gallery portlet (Note: This script will take about 7 hours to complete).
- Shut down Liferay.
- Run the upgrade process to the version you are testing on on your database. Observe the length of time it takes to complete UpgradeImageGallery.
Expected Result: UpgradeImageGallery completes fairly quickly
Actual Result: UpgradeImageGallery takes a long time to complete