merge causes OOPs in Person:+participation by introducing missing key in getPathsToTeams()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
High
|
j.c.sackett |
Bug Description
OOPS-1781EC1703 and OOPS-1781O1961 are two examples where the page fails to render because the team or person in the graph has disappeared. There where 32 of these the day before the 10.11 release.
/srv/launchpad.
Module lp.services.
value = self.populate(
Module lp.registry.
return len(self.
Module lp.services.
value = self.populate(
Module lp.registry.
paths, memberships = self.context.
Module lp.registry.
step = graph[step]
KeyError: <Person at 0x18d0ba50 adana-team (Adana Team)>
Related branches
- Brad Crittenden (community): Approve (code)
-
Diff: 229 lines (+125/-11)6 files modifiedlib/lp/registry/browser/peoplemerge.py (+5/-1)
lib/lp/registry/browser/tests/test_peoplemerge.py (+25/-7)
lib/lp/registry/doc/person-merge.txt (+4/-2)
lib/lp/registry/model/person.py (+35/-0)
lib/lp/registry/tests/test_person.py (+31/-1)
lib/lp/registry/tests/test_team.py (+25/-0)
- Brad Crittenden (community): Approve (code)
-
Diff: 130 lines (+52/-7)4 files modifiedlib/lp/registry/interfaces/teammembership.py (+4/-0)
lib/lp/registry/model/person.py (+7/-4)
lib/lp/registry/model/teammembership.py (+1/-3)
lib/lp/registry/tests/test_team.py (+40/-0)
summary: |
- Missing key in getPathsToTeams() + Person:+participation missing key in getPathsToTeams() |
Changed in launchpad-registry: | |
assignee: | nobody → j.c.sackett (jcsackett) |
summary: |
- Person:+participation missing key in getPathsToTeams() + merge causes OOPs in Person:+participation by introducing missing key in + getPathsToTeams() |
Changed in launchpad-registry: | |
status: | Triaged → In Progress |
Changed in launchpad-registry: | |
milestone: | 10.12 → series-future |
tags: |
added: qa-ok removed: qa-needstesting |
Changed in launchpad: | |
status: | Fix Committed → Fix Released |
Changed in launchpad: | |
milestone: | none → 11.01 |
I believe this issue relates to bug 651210 [Spurious entries in TeamParticipation]. I suspect this is an exacerbation of an older issue with merge.
The getPathsToTeams() method gets all the TP entries for the IPerson, filter out self, then builds a graph of all the TeamMemberships for the TP.team ids. *But* the graph cannot be built because the TP key is not in the TM data.
In the last few days, ~canonical-mobile, ~ubuntu-cl-website, and ~ubuntu-cl-dev teams were deleted. I believe merge is broken because ~registry should not be members of super teams that the deleted teams belonged to (/me struggles to keep ~registry's memberships sane). Delete uses revokeTeamMembe rship() for all direct team memberships before doing completing the merge.
The expectation is that all TP entries are correct before the merge process starts. The _mergeTeamMembe rship() step does work with both TM and TP, but maybe it fails because the data changes are not flushed to the db. TP has triggers; maybe the db is not in the state we think.