Pack already exists when pushing/autopacking

Bug #242510 reported by Martin Albisetti
8
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
John A Meinel
Launchpad itself
Fix Released
High
Unassigned

Bug Description

While pushing to loggerhead's trunk, I got:
bzr: ERROR: Pack '13c6ba3d1a8d731ec8f18bfb908585d6' already exists in <bzrlib.repofmt.pack_repo.RepositoryPackCollection object at 0x89eb72c>

This was while pushing revid: <email address hidden>

Related branches

Revision history for this message
Martin Albisetti (beuno) wrote :
Tim Penhey (thumper)
Changed in bzr:
status: New → Confirmed
Revision history for this message
Martin Albisetti (beuno) wrote :

Just hit this again with the LH branch.
Only after running "bzr pack" on the LP branch did I get it back to normal.

Bumping the importance to high.

Changed in bzr:
importance: Undecided → High
Jonathan Lange (jml)
Changed in launchpad-bazaar:
importance: Undecided → High
status: New → Triaged
Revision history for this message
John A Meinel (jameinel) wrote :

So, I just came up with a way to reproduce it. It is a logic bug in the autopacking logic.

bzr init creator
bzr init target
cd creator

for j in 1 55 24 30; do
  for i in `seq $j`; do
    bzr commit -m "$i, $j" --unchanged
  done
  bzr push ../target
done

The problem is thus...

When we get to the final push, we have pack files of size, 55, 30, 24, and 1. And a total of 110 revisions. Which means that the autopacking logic is going to try to push the existing packs together to get a pack of size 100, and one of size 10.

What happens is that it pushes together 55+30+24 = 109 (it is okay with a single-pack worth of overflow). It then tries to combine the "size 1" pack into a pack of size 10. However, there is nothing else for it to combine with, so it just goes ahead and creates a new pack that has exactly the same content.

And thus the target pack name already exists, and everything aborts.

There are a few different ways to handle this, Robert mentioned one about making the packer try harder. We could also detect that we are not changing anything and just not try to repack that object.

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 242510] Re: Pack already exists when pushing/autopacking

On Thu, 2008-09-18 at 22:58 +0000, John A Meinel wrote:
>
> What happens is that it pushes together 55+30+24 = 109 (it is okay
> with
> a single-pack worth of overflow). It then tries to combine the "size
> 1"
> pack into a pack of size 10. However, there is nothing else for it to
> combine with, so it just goes ahead and creates a new pack that has
> exactly the same content.
>
> And thus the target pack name already exists, and everything aborts.
>
> There are a few different ways to handle this, Robert mentioned one
> about making the packer try harder. We could also detect that we are
> not
> changing anything and just not try to repack that object.

Specifically, I was suggesting that just making a single 110 rev pack is
better - its less work and round trips. That would avoid this.

Also, checking that if we're autopacking with a single pack input, do
nothing, might be a good guard (though be sure not to prevent reconcile
from reconciling a fully packed repository).

--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

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

I have two fixes for this committed in the associate branch. Should make it into 1.8, we'll just see what version "wins out" for the final.

Changed in bzr:
assignee: nobody → jameinel
milestone: none → 1.8
status: Confirmed → Fix Committed
Revision history for this message
Martin Pool (mbp) wrote :

There may be some dupes of this...

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

Probable cause of OOPS-1000SMPU01 and OOPS-1000SMPM15

John A Meinel (jameinel)
Changed in bzr:
status: Fix Committed → Fix Released
Revision history for this message
Tim Penhey (thumper) wrote :

Fixed with the updated bzr on Launchpad.

Changed in launchpad-bazaar:
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.