Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-52316

Add constraints upgrade task is very slow in instances with a large amount of users

    XMLWordPrintable

Details

    Description

      Summary

      Upgrade hangs on EmbeddedCrowdAddMissingConstraintsClearDataUpgradeTask when upgrading to 5.10 or above

      Steps to Reproduce

      1. Connect Confluence 5.9 or below to LDAP to pull 50k+ users
      2. Run the upgrade past 5.10

      Expected Results

      Upgrade completes as expected

      Actual Results

      The upgrade hangs on:

      2017-04-25 18:16:09,646 INFO [localhost-startStop-1] [atlassian.confluence.upgrade.UpgradeTask] doUpgrade UnindexContentTypeUpgradeTask for status
      2017-04-25 18:16:09,653 INFO [localhost-startStop-1] [atlassian.confluence.upgrade.UpgradeTask] doUpgrade UnindexContentTypeTask enqueued
      
      Notes

      The query that it hangs on is the following:

      SELECT DISTINCT membership.id as id1_29_0_, membership.parent_id as parent_i2_29_0_, membership.child_group_id as child_gr3_29_0_, membership.child_user_id as child_us4_29_0_ 
      FROM cwd_membership membership, cwd_membership mem2 
      WHERE (membership.id <> mem2.id 
             AND membership.parent_id = mem2.parent_id 
             AND (membership.child_user_id = mem2.child_user_id 
             OR membership.child_group_id = mem2.child_group_id));
      

      For instances with very large user bases, this takes a long time to complete.

      Workaround

      1. Delete the external directory that has all of these users from -> General configuration -> User directories
      2. Run the upgrade
      3. Re-add the directory connector
        This is not recommended if you have an external directory set as 'Read only with local groups', as these memberships will be lost
        OR
      4. Wait for the upgrade to complete, it will just take longer than usual

      Attachments

        Issue Links

          Activity

            People

              glipatov George Lipatov
              dponzio Daniel Ponzio
              Votes:
              5 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: