Uploaded image for project: 'PUBLIC - Liferay Sync'
  1. PUBLIC - Liferay Sync
  2. SYNC-1768

Poor Performance when creating new user with many resourcePermissions

Details

    • Regression Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • Connector-4.1.1
    • Connector-4.1.2
    • Sync Connector
    • None
    • 3
    • 7.0.x

    Description

      Description:
      During User creating the UserModelListener.onBeforeAddAssociation fetches all resourcePermissions related to the roles that the new user will get (by default they are User and Power User) and returns the role's dlFolder and dlFileentries' syncDLObject entries.

      If there are lot of related resourcePermission entries, it causes performance issue during user creation.

      Steps to reproduce:
      1) Generate about 200000 resourcePermissions with the User role's roleId and with name:
      com.liferay.document.library.kernel.model.DLFileEntry
      You can find the script attached.
      2) Go to Users and Organization
      3) Add a new user
      Result: It takes about 30 seconds to add the new user

      More info:
      Caused by: SYNC-1704
      SYNC-1750 solves another issue

      Call chain:
      at com.liferay.sync.service.persistence.impl.SyncDLObjectPersistenceImpl.fetchByT_T(SyncDLObjectPersistenceImpl.java:4228)
      at com.liferay.sync.service.persistence.impl.SyncDLObjectPersistenceImpl.fetchByT_T(SyncDLObjectPersistenceImpl.java:4158)
      at com.liferay.sync.service.impl.SyncDLObjectLocalServiceImpl.fetchSyncDLObject(SyncDLObjectLocalServiceImpl.java:250)
      at com.liferay.sync.internal.model.listener.SyncBaseModelListener.getSyncDLObject(SyncBaseModelListener.java:52)
      at com.liferay.sync.internal.model.listener.SyncBaseModelListener$1.performAction(SyncBaseModelListener.java:79)
      at com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery.performActions(DefaultActionableDynamicQuery.java:85)
      at com.liferay.sync.internal.model.listener.SyncBaseModelListener.onAddRoleAssociation(SyncBaseModelListener.java:92)
      at com.liferay.sync.internal.model.listener.UserModelListener.onBeforeAddAssociation(UserModelListener.java:62)
      at com.liferay.portal.kernel.service.persistence.impl.TableMapperImpl._addTableMapping(TableMapperImpl.java:531)
      at com.liferay.portal.kernel.service.persistence.impl.TableMapperImpl.addTableMappings(TableMapperImpl.java:162)
      at com.liferay.portal.kernel.service.persistence.impl.ReverseTableMapper.addTableMappings(ReverseTableMapper.java:44)
      at com.liferay.portal.service.persistence.impl.UserPersistenceImpl.setRoles(UserPersistenceImpl.java:9451)
      at com.liferay.portal.service.impl.UserLocalServiceImpl.addUserWithWorkflow(UserLocalServiceImpl.java:1139)

      Attachments

        Issue Links

          Activity

            People

              alexander.matulionis Alexander Matulionis (Inactive)
              istvan.dezsi Istvan Dezsi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                5 years, 7 weeks, 2 days ago

                Packages

                  Version Package
                  Connector-4.1.2