TeamMembership:+index timeout deleting a member

Bug #664828 reported by Robert Collins
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Critical
Edwin Grubbs

Bug Description

https://lp-oops.canonical.com/oops.py/?oopsid=1755ED1750
https://edge.launchpad.net/%7Ecanonical-fae-team/+member/bobcheng/+index

Branch: launchpad-rev-11704
Revno: 11704
SQL time: 12684 ms
Non-sql time: 642 ms
Total time: 13326 ms
Statement Count: 274

This is simple death by SQL:

160. 7965 2ms SQL-launchpad-main-master SELECT Person.account, Person.creation_comment, Person.creation_rationale, Person.datecreated, Person.defaultmembershipperiod, Person.defaultrenewalperiod, Person.displayname, Person.hide_email_addresses, Person.homepage_content, Person.icon, Person.id, Person.logo, Person.mailing_list_auto_subscribe_policy, Person.merged, Person.mugshot, Person.name, Person.personal_standing, Person.personal_standing_reason, Person.registrant, Person.renewal_policy, Person.subscriptionpolicy, Person.teamdescription, Person.teamowner, Person.verbose_bugnotifications, Person.visibility FROM Person WHERE id IN ( -- All the super teams... SELECT team FROM TeamParticipation WHERE person = 2234420 AND team != 2234420 EXCEPT -- The one where person has an active membership. SELECT team FROM TeamMembership WHERE person = 3350139 AND status IN (3, 2) ) ORDER BY person_sort_key(Person.displayname, Person.name)
161. 7968 67ms SQL-launchpad-main-master SELECT EXISTS( SELECT 1 FROM TeamParticipation, TeamMembership WHERE TeamMembership.team = 3119008 AND TeamMembership.person = TeamParticipation.team AND TeamParticipation.person = 3350139 AND TeamMembership.status IN (3, 2))
162. 8036 1ms SQL-launchpad-main-master DELETE FROM TeamParticipation WHERE TeamParticipation.team = %s AND TeamParticipation.person = %s

repeats hundreds of times.

I'm arranging for a temporary timeout exception for this to unblock the user.
Changing this to just do a 4 queries should fix it for everything up to to thousands of teams.

Related branches

tags: added: timeout
Curtis Hovey (sinzui)
Changed in launchpad-registry:
status: New → Triaged
importance: Undecided → High
milestone: none → series-future
Revision history for this message
Curtis Hovey (sinzui) wrote :

Hi Edwin.

I think you may have fixed this bug will working on member add timeouts. Can you investigate if this is still an issue? If it is fixed, assign it to yourself and mark it fix released.

Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Curtis,

OOPS-1755ED1750 occurred after my branch landed that sends email in a job instead of during the page load. This oops is caused by _removeParticipantFromTeamAndSuperTeams() being recursive and the large number of super teams of ~canonical-fae-team. _cleanTeamParticipation() should be rewritten to only make a single query like _fillTeamParticipation() does.

Brad Crittenden (bac)
Changed in launchpad-registry:
assignee: nobody → Brad Crittenden (bac)
Curtis Hovey (sinzui)
Changed in launchpad:
assignee: Brad Crittenden (bac) → Edwin Grubbs (edwin-grubbs)
milestone: none → 11.01
status: Triaged → In Progress
Changed in launchpad:
importance: High → Critical
Revision history for this message
Launchpad QA Bot (lpqabot) wrote : Bug fixed by a commit
tags: added: qa-needstesting
Changed in launchpad:
status: In Progress → Fix Committed
Ursula Junque (ursinha)
Changed in launchpad:
milestone: 11.01 → 11.02
tags: added: qa-ok
removed: qa-needstesting
Curtis Hovey (sinzui)
Changed in launchpad:
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.