knitcorrupt error branching over hpss from unreconciled branch

Bug #164443 reported by Martin Pool
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Critical
Martin Pool

Bug Description

bzr.dev on the launchpad code host needs to have reconcile run on it to allow branching using bzr+ssh. Otherwise you get a traceback like this:

Traceback (most recent call last):
  File "/home/mbp/bzr/trunk/bzrlib/commands.py", line 802, in run_bzr_catch_errors
  File "/home/mbp/bzr/trunk/bzrlib/commands.py", line 758, in run_bzr
  File "/home/mbp/bzr/trunk/bzrlib/commands.py", line 492, in run_argv_aliases
  File "/home/mbp/bzr/trunk/bzrlib/builtins.py", line 893, in run
  File "/home/mbp/bzr/trunk/bzrlib/bzrdir.py", line 835, in sprout
  File "/home/mbp/bzr/trunk/bzrlib/repository.py", line 862, in fetch
  File "/home/mbp/bzr/trunk/bzrlib/decorators.py", line 165, in write_locked
  File "/home/mbp/bzr/trunk/bzrlib/repository.py", line 2528, in fetch
  File "/home/mbp/old/bzr.20071122/trunk/bzrlib/fetch.py", line 103, in __init__
    self.__fetch()
  File "/home/mbp/old/bzr.20071122/trunk/bzrlib/fetch.py", line 132, in __fetch
    self._fetch_everything_for_revisions(revs, pp)
  File "/home/mbp/old/bzr.20071122/trunk/bzrlib/fetch.py", line 408, in _fetch_everything_for_revisions
    self.to_repository.insert_data_stream(data_stream)
  File "/home/mbp/bzr/trunk/bzrlib/repository.py", line 792, in insert_data_stream
  File "/home/mbp/bzr/trunk/bzrlib/knit.py", line 756, in insert_data_stream
KnitCorrupt: Knit b8/join-branches.txt-20050309044946-f635037a889c0388 corrupt: line-delta from stream references missing parent <email address hidden>

Summary:
 * only happens on branches that need reconcile but haven't had it run
 * bzr.dev is in that category; few others are
 * not knit or pack specific

Tags: hpss
Martin Pool (mbp)
Changed in bzr:
importance: Undecided → Critical
milestone: none → 1.0rc1
status: New → Confirmed
Revision history for this message
Martin Pool (mbp) wrote :

Probably a duplicate of bug 164637; if it is, it won't be fixed until bzr is upgraded on the code host.

Revision history for this message
John A Meinel (jameinel) wrote :

Except I'm pretty sure bug #164637 is with packs, and this is occurring with knits.
Unless it is pulling from knits into packs, in which case it might be bug #165290.

Revision history for this message
Martin Pool (mbp) wrote :

I think I was actually branching into a pack repository, but I'll check.

Revision history for this message
Martin Pool (mbp) wrote :

This bug is reproducible in branching from knits to knits

Revision history for this message
Martin Pool (mbp) wrote :

@John

Bug 164637 is in generic code that's active for either knits or packs (viewed through the knit interface). However, we wouldn't normally expect it to be a problem when pulling from knits, because they should never have texts seen out of order in their index.

Changed in bzr:
assignee: nobody → mbp
Revision history for this message
Martin Pool (mbp) wrote :

This also happens when branching from the original branch on bazaar-vcs.org using bzr+ssh:

mbp@grace% bzr -Dhpss branch bzr+ssh://escudero.canonical.com//srv/www.bazaar-ng.org/rsync/bzr/bzr.dev trunk-escudero-ssh-packs
bzr-gtk is not up to date with installed bzr version 0.93.0.dev.0.
There should be a newer version available, e.g. 0.93.
bzr: warning: unsupported locale setting
  Could not determine what text encoding to use.
  This error usually means your Python interpreter
  doesn't support the locale set by $LANG (en_AU.UTF-8)
  Continuing with ascii encoding.
bzr: ERROR: bzrlib.errors.KnitCorrupt: Knit 86/quilt.txt-20050309044946-00df099b997fed5e corrupt: line-delta from stream references missing parent <email address hidden>

Traceback (most recent call last):
  File "/home/mbp/tmp/repo3/trunk/bzrlib/commands.py", line 802, in run_bzr_catch_errors
  File "/home/mbp/tmp/repo3/trunk/bzrlib/commands.py", line 758, in run_bzr
  File "/home/mbp/tmp/repo3/trunk/bzrlib/commands.py", line 492, in run_argv_aliases
  File "/home/mbp/repo3/trunk/bzrlib/builtins.py", line 893, in run
    possible_transports=[to_transport])
  File "/home/mbp/repo3/trunk/bzrlib/bzrdir.py", line 829, in sprout
    revision_id=revision_id)
  File "/home/mbp/repo3/trunk/bzrlib/remote.py", line 594, in sprout
    dest_repo.fetch(self, revision_id=revision_id)
  File "/home/mbp/repo3/trunk/bzrlib/repository.py", line 865, in fetch
    return inter.fetch(revision_id=revision_id, pb=pb, find_ghosts=find_ghosts)
  File "/home/mbp/tmp/repo3/trunk/bzrlib/decorators.py", line 165, in write_locked
  File "/home/mbp/repo3/trunk/bzrlib/repository.py", line 2755, in fetch
    pb=pb)
  File "/home/mbp/repo3/trunk/bzrlib/fetch.py", line 103, in __init__
    self.__fetch()
  File "/home/mbp/repo3/trunk/bzrlib/fetch.py", line 132, in __fetch
    self._fetch_everything_for_revisions(revs, pp)
  File "/home/mbp/repo3/trunk/bzrlib/fetch.py", line 408, in _fetch_everything_for_revisions
    self.to_repository.insert_data_stream(data_stream)
  File "/home/mbp/repo3/trunk/bzrlib/repository.py", line 794, in insert_data_stream
    (format, data_list, StringIO(knit_bytes).read))
  File "/home/mbp/repo3/trunk/bzrlib/knit.py", line 778, in insert_data_stream
    'missing parent %s' % parents[0])
KnitCorrupt: Knit 86/quilt.txt-20050309044946-00df099b997fed5e corrupt: line-delta from stream references missing parent <email address hidden>

bzr 0.93.0.dev.0 on python 2.5.1.final.0 (linux2)
arguments: ['/home/mbp/bin/bzr', '-Dhpss', 'branch', 'bzr+ssh://escudero.canonical.com//srv/www.bazaar-ng.org/rsync/bzr/bzr.dev', 'trunk-escudero-ssh-packs']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_AU.UTF-8'

Revision history for this message
Martin Pool (mbp) wrote :

And when branching locally from an rsync'd copy of that branch.

Applying a similar approach to bug 164637 - getting the vf from the repository.

I think this has failed even on reconciled repositories, but it may just be indicating that a check/reconcile is needed.

Revision history for this message
Martin Pool (mbp) wrote :

Branching in the same situation from a reconciled branch does work.

So the options seem to be

0- Do nothing, just tell people to upgrade if they hit it
1- Change insert_data_stream to raise errors that suggest reconciling the source repository
2- Change insert_data_stream to detect this case and fall back to specifically fetching the missing text versions
3- Make get_data_stream automatically detect when this has happened and work around it - maybe by specially sending texts that aren't referenced by their containing revisions. This would be nice and clean, but fairly complicated and expensive for a situation people should rarely hit.

Martin Pool (mbp)
description: updated
Revision history for this message
Martin Pool (mbp) wrote :

We now give a clearer message (option #1), so I'm going to mark this closed. If this turns out to be more common we may need to revisit this.

Changed in bzr:
status: Confirmed → Fix Released
Revision history for this message
Martin Pool (mbp) wrote :

For Launchpad, we plan to address this by upgrading bzr.dev to packs and letting it re-pull the whole thing. This should have now happened.

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.