Atomic "move package" operation

Bug #1329052 reported by Colin Watson
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Low
Colin Watson
ubuntu-archive-tools
Fix Released
Low
Iain Lane

Bug Description

proposed-migration needs to copy migrateable packages from proposed to release and then delete them from proposed. At present it does this by calling Archive.copyPackage (which schedules an asynchronous copy job) and then if that succeeds it calls SPPH.requestDeletion (which operates synchronously). This mostly works well enough in practice despite being ugly. However, there are some edge cases where it goes wrong:

 * It is possible for the copy job to succeed but the deletion to time out or similar. In this case we end up with stray publications in -proposed that need to be cleaned up by hand. (This is minor.)
 * It is possible, though thankfully rare, for the copy job to fail with an OOPS or similar, but the deletion to succeed. This is bad as it causes the upload to go missing and require manual resurrection. Hopefully somebody will notice ...
 * It is possible for the async copy jobs to run after the deletion is processed, and furthermore narrowly possible for the publisher to run in between the deletion and the copy job. In this case everything will sort itself out on the next publisher run, but there will be a window where the upload in question will be missing from both release and proposed pockets in the published archive, causing considerable confusion.

The correct fix for all of these is to have a transactional "move package" operation in Launchpad. I would suggest that it could simply be a move=True keyword argument to Archive.copyPackage, which is passed down through the PCJ to the copier itself and causes a deletion at the end of the copy before committing the transaction.

Related branches

Colin Watson (cjwatson)
Changed in ubuntu-archive-tools:
status: New → Triaged
importance: Undecided → Low
William Grant (wgrant)
tags: added: package-copies soyuz-core
Colin Watson (cjwatson)
Changed in launchpad:
status: Triaged → In Progress
assignee: nobody → Colin Watson (cjwatson)
Revision history for this message
Colin Watson (cjwatson) wrote :

Almost there, but I forgot to declare "move" as a parameter to Archive.copyPackage in the webservice API, so it isn't usable yet. Oops.

Revision history for this message
Colin Watson (cjwatson) wrote :

All done in Launchpad a while ago.

Changed in launchpad:
status: In Progress → Fix Released
Revision history for this message
Colin Watson (cjwatson) wrote :

ubuntu-archive-tools uses this as of r1455, thanks to Iain.

Changed in ubuntu-archive-tools:
assignee: nobody → Iain Lane (laney)
status: Triaged → 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.