Uploaded image for project: 'Ranger'
  1. Ranger
  2. RANGER-2639

XUserService has duplicate db query in when populateViewBean for XXUser

    XMLWordPrintableJSON

    Details

      Description

      when request http api /service/xusers/users with GET method.ranger admin will query db and get XXUser,then transform the XXUser to VXUser. in the tranformation process,

      XUserService.populateUserAttributes() method is called two times.and make extra 2 times db query.when the result users are many,this causes significant performance issue,rougly 40% performance down。so indeed we need to call populateUserAttributes() once .

      we found this issue in our production environment with 1000+ users in ranger admin,and start the kafka or other component which enabled ranger authority.in the start process, setup_ranger_xxxx() is called and make http /service/xusers/users request to ranger.as it query all users in ranger,ranger admin will reponse in several ten seconds.

        Attachments

        1. XUserService.patch
          0.4 kB
          zhangxiong

          Activity

            People

            • Assignee:
              leslizhang zhangxiong
              Reporter:
              leslizhang zhangxiong
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified