caching writes to pack repository causes ShortReadvError on pushing stacked branch

Bug #303856 reported by Michael Hudson-Doyle
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Martin Pool

Bug Description

This branch to has been committed to by all sorts of pre-release versions of bzr, so it might well be broken in subtle ways, but still:

mwh@grond:manual-stacking-on-launchpad-branches-bug-272372$ bzr push
Using saved push location: bzr+ssh://bazaar.launchpad.net/~mwhudson/launchpad/manual-stacking-on-launchpad-branches-bug-272372
bzr: ERROR: bzrlib.errors.ShortReadvError: readv() read 0 bytes rather than 185 bytes at 25704 for "00/00/71/72/.bzr/repository/upload/iry9c2gg0oqyzllil702.pack"

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 893, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 839, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 539, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 913, in run
    use_existing_dir=use_existing_dir)
  File "/usr/lib/python2.5/site-packages/bzrlib/push.py", line 162, in _show_push_branch
    stop_revision=revision_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 138, in read_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1799, in push
    _override_hook_source_branch=_override_hook_source_branch)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 2508, in _run_with_write_locked_target
    result = callable(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1838, in _push_with_bound_branches
    result = self._basic_push(target, overwrite, stop_revision)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1861, in _basic_push
    graph=graph)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/remote.py", line 1768, in update_revisions
    self.fetch(other, stop_revision)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 286, in fetch
    pb=nested_pb)
  File "/usr/lib/python2.5/site-packages/bzrlib/remote.py", line 838, in fetch
    return inter.fetch(revision_id=revision_id, pb=pb, find_ghosts=find_ghosts)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 2848, in fetch
    pb, find_ghosts, set_cache_size)
  File "/usr/lib/python2.5/site-packages/bzrlib/fetch.py", line 118, in __init__
    self.__fetch()
  File "/usr/lib/python2.5/site-packages/bzrlib/fetch.py", line 148, in __fetch
    self._fetch_everything_for_search(search, pp)
  File "/usr/lib/python2.5/site-packages/bzrlib/fetch.py", line 191, in _fetch_everything_for_search
    not self.to_repository._fetch_uses_deltas))
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 1443, in insert_record_stream
    record, record.get_bytes_as(record.storage_kind)))
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 229, in get_bytes
    [compression_parent], 'unordered', True).next()
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 1185, in get_record_stream
    ordering, include_delta_closure):
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 1281, in _get_remaining_record_stream
    text_map, _ = self._get_content_maps(keys, non_local)
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 1005, in _get_content_maps
    record_map = self._get_record_map(keys, allow_missing=True)
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 1133, in _get_record_map
    for key, record, digest in self._read_records_iter(records):
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 1673, in _read_records_iter
    izip(iter(needed_records), raw_data):
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 2540, in get_raw_records
    for names, read_func in reader.iter_records():
  File "/usr/lib/python2.5/site-packages/bzrlib/pack.py", line 253, in iter_records
    self._read_format()
  File "/usr/lib/python2.5/site-packages/bzrlib/pack.py", line 294, in _read_format
    format = self._read_line()
  File "/usr/lib/python2.5/site-packages/bzrlib/pack.py", line 221, in _read_line
    line = self._source.readline()
  File "/usr/lib/python2.5/site-packages/bzrlib/pack.py", line 185, in readline
    self._next()
  File "/usr/lib/python2.5/site-packages/bzrlib/pack.py", line 172, in _next
    length, data = self.readv_result.next()
  File "/usr/lib/python2.5/site-packages/bzrlib/transport/remote.py", line 360, in _readv
    self._translate_error(err, relpath)
  File "/usr/lib/python2.5/site-packages/bzrlib/transport/remote.py", line 425, in _translate_error
    remote._translate_error(err, path=relpath)
  File "/usr/lib/python2.5/site-packages/bzrlib/remote.py", line 1886, in _translate_error
    args[0], int(args[1]), int(args[2]), int(args[3]))
ShortReadvError: readv() read 0 bytes rather than 185 bytes at 25704 for "00/00/71/72/.bzr/repository/upload/iry9c2gg0oqyzllil702.pack"

bzr 1.11dev on python 2.5.2 (linux2)
arguments: ['/usr/bin/bzr', 'push']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_NZ.UTF-8'
plugins:
  avahi /home/mwh/.bazaar/plugins/avahi [0.3dev]
  bpm /home/mwh/.bazaar/plugins/bpm [unknown]
  dbus /home/mwh/.bazaar/plugins/dbus [unknown]
  fastimport /home/mwh/.bazaar/plugins/fastimport [unknown]
  gtk /home/mwh/.bazaar/plugins/gtk [0.95.0.dev.1]
  launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  loom /home/mwh/.bazaar/plugins/loom [1.4dev]
  lpreview /home/mwh/.bazaar/plugins/lpreview [unknown]
  merged /home/mwh/.bazaar/plugins/merged [unknown]
  pqm /home/mwh/.bazaar/plugins/pqm [1.4dev]
  pybloom /home/mwh/.bazaar/plugins/pybloom [unknown]
  search /home/mwh/.bazaar/plugins/search [1.6dev]
  service /home/mwh/.bazaar/plugins/service [unknown]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.

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

It looks like this was caused by spiv's patch to have more write-buffering of in-progress packs, and it could be fixed by reverting that change, which should be done for 1.10final.

Changed in bzr:
importance: Undecided → High
milestone: none → 1.10final
status: New → Confirmed
assignee: nobody → mbp
Revision history for this message
Martin Pool (mbp) wrote :
Revision history for this message
Martin Pool (mbp) wrote :

I've sent a fix to the 1.10 branch that reverses the patch for bug 294479.

Changed in bzr:
status: Confirmed → Fix Committed
John A Meinel (jameinel)
Changed in bzr:
status: Fix Committed → Fix Released
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.