Race in puller with stacked branches

Bug #261334 reported by Jonathan Lange
14
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Medium
Jonathan Lange

Bug Description

If the puller mirrors a stacked branch before it mirrors the stacked-on branch, the mirrored branch is not going to work. It's not *so* bad, because the next time the puller runs, it *will* have the stacked-on branch and will thus be able to mirror the stacked branch.

Jonathan Lange (jml)
Changed in launchpad-bazaar:
assignee: nobody → jml
importance: Undecided → Medium
milestone: none → 2.1.9
status: New → Triaged
Revision history for this message
Jonathan Lange (jml) wrote :

The problem is that we can try to mirror stacked branches before stacked-on branches are mirrored. The extreme form of this is when the stacked-on branch hasn't been mirrored at all. This leads to "Not a branch" errors on the stacked branch user page, and means that the stacked branch will not be available until a mirror is triggered on the stacked-on branch *followed by* a mirror being triggered on the stacked branch. That is, the stacked branch won't be available to the public until a long, long time after it's uploaded. Milder forms are when it's just out of date. This just leads to a bigger-than-necessary stacked branch.

I had a chat with Michael and we came up with this plan:

When mirroring a stacked branch:
    * check if the stacked-on branch is up-to-date (especially, does it exist?)
    * if it is, mirror as usual
    * if not, DEFER mirroring.

After *successfully* mirroring a stacked-on branch:
    * Request mirrors for all DEFERRED branches stacked on it.

The DEFER operation should look to the user as if no mirror attempt has been made, and make no promise about the next mirror time. We should be able to tell when a branch is DEFERRED because last_mirror_attempt > last_mirrored. (This is ugly. We should change the schema so we can be explicit about this. Options include: explicit status field; recording the rev id of the tip of the branch in the upload area; changing the schema to be more like code imports).

Jonathan Lange (jml)
Changed in launchpad-bazaar:
status: Triaged → In Progress
Revision history for this message
Jonathan Lange (jml) wrote :

This is in PQM now.

Revision history for this message
Jonathan Lange (jml) wrote :

RF 6997

Changed in launchpad-bazaar:
status: In Progress → Fix Committed
Jonathan Lange (jml)
Changed in launchpad-bazaar:
status: Fix Committed → Fix Released
Curtis Hovey (sinzui)
visibility: private → public
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.