Fetching user group info on deleted users creates unnecessary load

Bug #1281750 reported by Bill Erickson
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
High
Unassigned
2.4
Fix Released
High
Unassigned
2.5
Fix Released
High
Unassigned

Bug Description

Evergreen 2.4+

When a user is purged, the user is put into usergroup "0". This results in a large, unbounded collection of users within a single group. Not a big deal, until the staff client attempts to load data for every user within the group, which happens if a purged user is accessed in the staff client and the "group member details" tab is opened.

First noticed when "open-ils.actor.usergroup.members.retrieve.authoritative <authtoken>, 0" was seen returning thousands of responses, causing a load spike.

Patch forthcoming to exit early from usergroup info API calls when usergroup == 0

Revision history for this message
Bill Erickson (berick) wrote :

Hmm, actually, a better solution would be to limit the user search calls to users which are not deleted. It looks like that was an oversight from early on. 2 birds / one stone.

Revision history for this message
Bill Erickson (berick) wrote :
Changed in evergreen:
milestone: none → 2.6.0-rc1
assignee: Bill Erickson (erickson-esilibrary) → nobody
tags: added: pullrequest
Revision history for this message
Mike Rylander (mrylander) wrote :

Marking this with High importance because this can cause a user-visible server outage for sites with many deleted users.

Changed in evergreen:
importance: Undecided → High
status: New → Confirmed
Dan Wells (dbw2)
tags: added: 2.6-rc-blocker
Revision history for this message
Remington Steed (rjs7) wrote :

Tested and works as expected. I didn't test the heavy load, but since this code prevents retrieving the ids of deleted users, it therefore cannot subsequently fetch other data from those users. Here are my test results:

request open-ils.actor open-ils.actor.usergroup.members.retrieve.authoritative "AUTHTOKEN", 0
-- BEFORE: returns list of user ids
-- AFTER: returns empty list

request open-ils.actor open-ils.actor.usergroup.leaders.retrieve "AUTHTOKEN", 0
-- BEFORE: returns list of user ids
-- AFTER: returns empty list

I couldn't test the other two (usergroup.members.balance_owed and address.members) in the same way, but it seems clear that the code will work in all four cases. So here is my signoff branch.

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/rsteed/lp1281750-ignore-usergroup-0

working/user/rsteed/lp1281750-ignore-usergroup-0

Dan Wells (dbw2)
Changed in evergreen:
assignee: nobody → Dan Wells (dbw2)
Revision history for this message
Dan Wells (dbw2) wrote :

A straightforward and valuable fix. Thanks, Bill and Remington!

Changed in evergreen:
status: Confirmed → Fix Committed
assignee: Dan Wells (dbw2) → nobody
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.