Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-74690

Poor Performance in v7_0_0.UpgradeDocumentLibrary#updateFileEntryFileNames

    Details

      Description

      Description
      The UpgradeDocumentLibrary#updateFileEntryFileNames process selects every single DLFileEntry and populates their fileNames one by one. Moreover, the logic in this process is convoluted and doesn't even seem to make sense when closely analyzed. We should rewrite this method to require as few SQL statements as possible and to not risk exceptions such as a Constraint Violation Exception or a Max Length Exceeded exception, nor should we risk an infinite loop.

      Steps to Reproduce
      1. Start up Liferay 6.2 connected to a fresh database.
      2. Log in as the admin user.
      3. Run the attached groovy script.
      4. Shut down Liferay.
      5. Attempt to upgrade to Liferay 7.
      6. Observe the length of time it takes to run the v7_0_0.UpgradeDocumentLibrary#updateFileEntryFileNames process.

      Expected Result: The upgrade process completes within a few minutes.
      Actual Result: The upgrade process takes roughly three hours to process the first 100001 documents. I believe that once it gets to the 100002nd document it would get stuck in an infinite loop, but I have not actually waited long enough to confirm that this is the case.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              abel.yu Abel Yu (Inactive)
              Reporter:
              michael.bowerman Michael Bowerman
              Participants of an Issue:
              Recent user:
              Csaba Turcsan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                3 years, 32 weeks, 2 days ago

                  Packages

                  Version Package
                  7.0.0 DXP FP41
                  7.0.6 CE GA7
                  7.0.0 DXP SP8
                  7.0.X
                  7.1.0 M2
                  7.1.X
                  Master