Overlapping autopacks can lead to unreachable revisions causing NoSuchRevision
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Critical
|
John A Meinel | ||
2.0 |
Fix Released
|
Critical
|
John A Meinel |
Bug Description
Occasionally when autopacks overlap you can get a branch into a state where subsequent commands will fail on that branch and "bzr check" reports errors in the repository.
I discovered this while trying to reproduce 495000, 507553 and 507557. At first I thought it only happened while I was doing stuff in the debugger but then I started getting it in normal usage too. The attached shell script will eventually reproduce it if you wait a while (you'll start seeing "NoSuchId" errors).
The method to reproduce is very similar to those other bugs:
1. At the very top of _create_
import pdb
2. Create a dummy repository:
bzr init-repo testrepo
bzr init testrepo/branch1
bzr branch testrepo/branch1 testrepo/branch2
3. Commit until it breaks into the debugger (should be the 10th time):
bzr commit -m "test" --unchanged testrepo/branch1
4. In a separate window, commit on the other branch:
bzr commit -m "test" --unchanged testrepo/branch2
5. Both windows should now be in the debugger.
6. In the first window type "c" to continue. The commit should finish successfully.
7. In the second window type "c". The commit will also succeed, but testrepo/branch2 is now broken.
If you try "bzr log testrepo/branch2" you get:
bzr: ERROR: Revision {<email address hidden>} not present in "CHKInventoryRe
If you do "bzr check testrepo" you get:
Checking working tree at '/Users/
Checking branch at 'file:/
Checking working tree at '/Users/
Checking branch at 'file:/
Checking repository at 'file:/
bzr: ERROR: bzrlib.
Also, if you try this procedure on a branch that has files in it and use non-empty commits they will fail with:
aborting commit write group: NoSuchId(The file id "tree_root-
bzr: ERROR: The file id "tree_root-
I'm guessing that one or more pack files have been "orphaned" somehow.
Related branches
- Robert Collins (community): Approve
-
Diff: 105 lines (+54/-4)3 files modifiedNEWS (+5/-0)
bzrlib/repofmt/pack_repo.py (+8/-3)
bzrlib/tests/test_repository.py (+41/-1)
Changed in bzr: | |
status: | New → Confirmed |
importance: | Undecided → Critical |
summary: |
- Overlapping autopacks can lead to repository corruption + Overlapping autopacks can lead to unreachable revisions causing + NoSuchRevision |
tags: | added: 2a |
Changed in bzr: | |
assignee: | nobody → John A Meinel (jameinel) |
Changed in bzr: | |
status: | In Progress → Fix Released |
I just realised "Repository corruption" may sound a bit alarmist; feel free to change it to a more appropriate term.