Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-78797

Adding a user to a role or creating a customer is slow for roles in projects with many user role assignments

XMLWordPrintable

    • 9.13
    • 1
    • Severity 1 - Critical
    • 1
    • Hide
      The implementation that caused the regression is valuable and will not be reverted; it actually fixes another, more severe problem: https://jira.atlassian.com/browse/JRASERVER-75605. The fix to the above was not trivial, as the new algorithm needed a caching layer, which was new and not optimised. It now flushes too many keys to avoid analysing which keys to flush, which causes new problems.

      While we do not have a resolution atm the team will look into options for further optimisation to mitigate the need for flushing. Please follow this ticket for updates in the upcoming days and further information on the fixed version.
      Show
      The implementation that caused the regression is valuable and will not be reverted; it actually fixes another, more severe problem: https://jira.atlassian.com/browse/JRASERVER-75605 . The fix to the above was not trivial, as the new algorithm needed a caching layer, which was new and not optimised. It now flushes too many keys to avoid analysing which keys to flush, which causes new problems. While we do not have a resolution atm the team will look into options for further optimisation to mitigate the need for flushing. Please follow this ticket for updates in the upcoming days and further information on the fixed version.

      Issue Summary

      Adding a user to a role takes a long time as the number of users in that project role grows.

      This can be particularly impactful for environments that have public signup enabled and projects in which JSM is configured so anyone can raise an issue by email.

      Steps to Reproduce

      1. Install a vanilla instance of Jira Service Management Data Center (JSM DC) on version 5.12.latest.
        • The instance should have 2 or more nodes to trigger the bug.
      2. Create a sample Business (Core) project.
      3. Run the following script.
        JIRA_BASE_URL=https://myjira.com
        JIRA_ADMIN_USRNAME=myusername
        JIRA_ADMIN_PWD=mypassword
        
        USERNAME_PREFIX=sampleuser
        PROJECT_KEY=SCRUM1
        
        for i in $(seq 1 1000); do
          new_username=${USERNAME_PREFIX}${i}
          new_password=${USERNAME_PREFIX}${i}
          new_email="${USERNAME_PREFIX}${i}@user.com"
          new_displayname=${USERNAME_PREFIX}${i}
        
          USER_KEY=$(curl -s -k -L -XPOST \
           -H 'Content-Type: application/json' \
           -u ${JIRA_ADMIN_USRNAME}:${JIRA_ADMIN_PWD} \
           ${JIRA_BASE_URL}'/rest/api/latest/user' \
           -d '{"name": "'${new_username}'","password": "'${new_password}'","emailAddress": "'${new_email}'","displayName": "'${new_displayname}'","applicationKeys": ["jira-software"]}' | jq -r '.key')
        
          echo ${USER_KEY}
        
          time curl -s -o /dev/null ${JIRA_BASE_URL}'/rest/projectconfig/latest/roles/'${PROJECT_KEY}'/10002' -X POST \
          -u ${JIRA_ADMIN_USRNAME}:${JIRA_ADMIN_PWD} \
          -H 'Content-Type: application/json' \
          --data-raw '{"groups":[],"users":["'${USER_KEY}'"]}'
        done
        
        • This script will sequentially create a user record and then add it to a project role.
        • Note the time doesn't increase and is mostly constant.
      4. Create a sample ITSM project.
      5. Run the following script.
        JIRA_BASE_URL=https://myjira.com
        PROJECT_KEY=ITSM1
        
        for i in $(seq 1 2000); do
        time curl -s \
          ${JIRA_BASE_URL}'/rest/servicedesk/1/pages/people/customers/pagination/'${PROJECT_KEY}'/invite' \
          -X POST \
          -H 'Authorization: Bearer PAT-key' \
          -H 'Accept: application/json, text/plain, */*' \
          -H 'Content-Type: application/json' \
          --data-raw '{"emails":["customer'${i}'@customer.net"]}'
        done
        
        • This script will sequentially create add a customer to the project.
        • Note the time doesn't increase and is mostly constant.
      6. Install a vanilla instance of JSM DC 10.3.latest.
        • The instance should have 2 or more nodes to trigger the bug.
      7. Run the same steps detailed above.

      Expected Results

      The time to add a new user to a project role or to add a customer remains similar to JSM DC 5.12 and remains mostly constant with more users.

      Actual Results

      The time to add a new user to a project role or to add a customer continuously increases with more users in the project.

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

              lwlodarczyk Lukasz Wlodarczyk
              5fb7769fcbc7 Allan Gandelman
              Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: