Deleted sources can leave binaries hanging around forever

Bug #684180 reported by Julian Edwards
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Julian Edwards

Bug Description

In the case where someone deletes a source before the binaries are built and accepted (and thus get publications), the binaries will be orphaned causing the source to never get scheduled for deletion.

Related branches

Revision history for this message
Julian Edwards (julian-edwards) wrote :

This has performance implications for the publisher, because it picks up the archives with pending deletions each time it runs.

Changed in soyuz:
status: New → Triaged
importance: Undecided → High
tags: added: soyuz-core soyuz-publisher
Revision history for this message
Julian Edwards (julian-edwards) wrote :

This query shows affected publications.

select spph.id from archive, sourcepackagepublishinghistory as spph
where
        archive.purpose=2 and
        spph.archive = archive.id and
        spph.scheduleddeletiondate is null and
        spph.datepublished is null and
        spph.status in (1,4)

Revision history for this message
Julian Edwards (julian-edwards) wrote :

For cleaning up I think it's safe, where a source was deleted without ever being published, to mark all its binaries as deleted and let the domination DTRT with source and binary.

The +delete-packages forum currently carries on presenting sources for deletion if it sees that there are still published binaries. This is a little counter-intuitive since the package appears as "deleted" and there's no explicit mention of the binary state, so you're left wondering what's up.

If we fix IArchive.getSourcesForDeletion() to not return any source that has a build in progress, we should be able to avoid this. We can delete the source if the build is not yet active and the buildd-manager would supersede the build, but I need to think about race conditions there where we would mark the source deleted at the same moment as the build is dispatched.

summary: - Disallow package deletion if it has pending builds
+ Deleted sources can leave binaries hanging around forever
Revision history for this message
Julian Edwards (julian-edwards) wrote :

Wgrant has pointed out that a better solution will be to drop binaries as soon as we get them from the builders if the source was deleted or superseded before the build finished.

Changed in soyuz:
status: Triaged → In Progress
Changed in soyuz:
assignee: nobody → Julian Edwards (julian-edwards)
tags: added: buildd-manager
removed: soyuz-core soyuz-publisher
Tom Haddon (mthaddon)
tags: added: canonical-losa-lp
Revision history for this message
Launchpad QA Bot (lpqabot) wrote : Bug fixed by a commit
tags: added: qa-needstesting
Changed in soyuz:
status: In Progress → Fix Committed
tags: added: qa-ok
removed: qa-needstesting
Curtis Hovey (sinzui)
Changed in launchpad:
status: Fix Committed → Fix Released
Curtis Hovey (sinzui)
Changed in launchpad:
milestone: none → 11.01
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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