'Revision X not present': when branching from stacked branch with ghosts

Bug #368418 reported by Bob Tanner
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Critical
Andrew Bennetts

Bug Description

Merged in Bug 354036 for 1.13.2 release. PQM was happy. I'm attempting to re-pull the master branch (per Releasing doc) and I'm getting the follow error.

$ bzr branch http://code.launchpad.net/~bzr/bzr/bzr.1.13 bzr-1.13.2
http://code.launchpad.net/%7Ebzr/bzr/bzr.1.13/ is redirected to https+urllib://code.launchpad.net/%7Ebzr/bzr/bzr.1.13/
bzr: ERROR: Revision {[('<email address hidden>',)]} not present in "KnitVersionedFiles(_KnitGraphIndex(CombinedGraphIndex()), <bzrlib.knit._DirectPackAccess object at 0x878086c>)".

Talked to spiv and lifeless on irc about it. spiv

Tags: hpss

Related branches

Revision history for this message
Bob Tanner (tanner) wrote :
Changed in bzr:
milestone: none → 1.13.2
Revision history for this message
Bob Tanner (tanner) wrote :

spiv notes: "Although I do notice that that branch [1.13] has the AbsentContentFactory bug!"

Revision history for this message
Andrew Bennetts (spiv) wrote :

The traceback shows that it's in the "if missing_keys" branch of fetch.py's _fetch_everything_for_search. i.e. fetch has decided that that key is either a missing compression parent or missing parent inventory, but the source does not have that key.

Revision history for this message
Bob Tanner (tanner) wrote :

Using

Bazaar (bzr) 1.14rc2
  from bzr checkout /tmp/bzr-1.14
    revision: 4254

Successfully branches for me.

$ /tmp/bzr-1.14/bzr branch http://code.launchpad.net/~bzr/bzr/bzr.1.13 bzr-1.13.2
Branched 4114 revision(s).

Revision history for this message
Andrew Bennetts (spiv) wrote :

I can reproduce this when branching standalone, but not in my shared repository. That revision is a ghost in my shared repository though.

I also cannot reproduce by branching *from* my shared repository — but that takes a different code path. This bug happens when the source is stacked, which makes InterPackRepo use the generic RepoFetcher rather than its own logic. When I make a trivially stacked branch from shared repository and branch that, then I can reproduce locally. The missing_key it finds is due to the new parent inventory check in bzr.dev, I think. Perhaps that code isn't taking ghosts into account adequately?

Revision history for this message
Andrew Bennetts (spiv) wrote :

So, to reproduce, take your local bzr.dev and do this:

   $ bzr branch --stacked bzr.dev trivial-stacked
   $ bzr branch trivial-stacked new-standalone

If you instrument the fetch code you'll see:

missing keys: set([('inventories', '<email address hidden>'), ('inventories', '<email address hidden>')])

Changed in bzr:
assignee: nobody → Andrew Bennetts (spiv)
importance: Undecided → Critical
milestone: 1.13.2 → none
status: New → In Progress
Revision history for this message
Andrew Bennetts (spiv) wrote :

Those two ghosts are referenced from these two revisions: <email address hidden> and <email address hidden>

Revision history for this message
Andrew Bennetts (spiv) wrote :

So basically ghosts are tripping up the new sanity checks in StreamSink.insert_stream. If I relax the checks to only require left-hand parent inventories then this fetch succeeds.

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 368418] Re: ERROR: Revision X not present

On Tue, 2009-04-28 at 09:18 +0000, Andrew Bennetts wrote:
> So basically ghosts are tripping up the new sanity checks in
> StreamSink.insert_stream. If I relax the checks to only require left-
> hand parent inventories then this fetch succeeds.

ghosts can occur on the lefthand side too.

Basically we need to differentiate between ghosts and nonghosts in these
cases.

The requested inventories should be right in all cases; an inventory we
can't send for which the rev is missing too is a ghost, I think.

Rob

Andrew Bennetts (spiv)
summary: - ERROR: Revision X not present
+ 'Revision X not present': when branching from stacked branch with ghosts
Revision history for this message
Andrew Bennetts (spiv) wrote :

Summary of where we are:

 * the problem is that missing parent inventories aren't necessarily a problem, so the check introduced in r4307 is too strict. Ghosts cause missing parents, but can do so harmlessly. The actual problem the code wants to catch is when we have an inventory but not all the texts it introduces. i.e. for every text version in an inventory in a possibly stacked repo, we require that either a parent inventory also references that version (so we know the current inventory didn't introduce it) or that that text version is present in this repository.
 * I have a branch with a tentative fix. It certainly copes with the ghosts in bzr.dev, but obviously I want to make sure it's robust for all cases...

Andrew Bennetts (spiv)
Changed in bzr:
milestone: none → 1.15rc1
tags: added: hpss
tags: added: lp-cp
tags: removed: lp-cp
Revision history for this message
Andrew Bennetts (spiv) wrote :

https://code.launchpad.net/~spiv/bzr/all-referenced-texts-check has a fix for this, and has been submitted for review.

Changed in bzr:
status: In Progress → Fix Committed
Revision history for this message
Vincent Ladeuil (vila) wrote :

Merged in bzr.dev in revno 4353. There is no NEWS entry though :-/

Changed in bzr:
status: Fix Committed → Fix Released
Revision history for this message
Andrew Bennetts (spiv) wrote :

There's no NEWS entry because, IIRC, this bug wasn't in 1.14.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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