revno cache out of sync with actual branch revnos

Bug #390490 reported by Ted Gould
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

Working with a branch this evening and through a series of commands eventually got to "Commited revision 1" which is bad on a repository with about 1900 revisions. Fortunately they all seem to be there, but now they are negative. Here is now the first version as given by bzr log:

------------------------------------------------------------
revno: -1906
svn revno: 0 (on /)
committer:
timestamp: Thu 2003-09-04 21:43:46 +0000
message:
  (no message)

I've attached a bzr.log for this evening. The only thing that I think might be odd is that I was working in different directories of the same repository in different terminal windows. Also, I do almost all operations specifying the directory (eg "commit .") as the repository is large and I'm trying to reduce the amount of computation.

Tags: revno
Revision history for this message
Ted Gould (ted) wrote :
Revision history for this message
Ted Gould (ted) wrote :

The log is rather intermixed. On one of the terminals I have some useful scrollback:

$ bzr add album.xml
Unable to obtain lock file:///media/Photos/Photos/.bzr/checkout/lock
held by <email address hidden> on host shi [process #24574]
locked 6 seconds ago
Will continue to try until 22:49:59, unless you press Ctrl-C
If you're sure that it's not being modified, use bzr break-lock file:///media/Photos/Photos/.bzr/checkout/lock
adding Unsorted/2009/530_NathanSarah/album.xml
$ bzr commit -m "Album information for these guys' wedding" album.xml
Unable to obtain lock file:///media/Photos/Photos/.bzr/branch/lock
held by <email address hidden> on host shi [process #24579]
locked 20 seconds ago
Will continue to try until 22:50:55, unless you press Ctrl-C
If you're sure that it's not being modified, use bzr break-lock file:///media/Photos/Photos/.bzr/branch/lock
Committing to: /media/Photos/Photos/
added Unsorted/2009/530_NathanSarah/album.xml
Committed revision 1.
$

Revision history for this message
Ted Gould (ted) wrote :
Download full text (4.5 KiB)

Okay, so I ran 'bzr reconcile' for a little while, about 45 minutes or so. It wasn't finishing and I got tired of waiting so I hit cntrl-c on it. Now my revisions are correct. Here's the log. I'm not sure if it helps anything:

Sun 2009-06-21 22:50:54 -0500
0.046 bzr arguments: [u'reconcile']
0.083 looking for plugins in /home/ted/.bazaar/plugins
0.235 looking for plugins in /usr/lib/python2.6/dist-packages/bzrlib/plugins
0.270 encoding stdout as sys.stdout encoding 'UTF-8'

Sun 2009-06-21 22:51:08 -0500
0.017 bzr arguments: [u'help', u'reconcile']
0.029 looking for plugins in /home/ted/.bazaar/plugins
0.190 looking for plugins in /usr/lib/python2.6/dist-packages/bzrlib/plugins
0.223 encoding stdout as sys.stdout encoding 'UTF-8'
0.350 return code 0
171.824 Resizing the inventory entry cache from 10240 to 14224
199.467 Resizing the inventory entry cache from 14224 to 19144
421.913 Resizing the inventory entry cache from 19144 to 25578
557.380 Resizing the inventory entry cache from 25578 to 34200
1039.470 Resizing the inventory entry cache from 34200 to 45670
1485.822 Resizing the inventory entry cache from 45670 to 61320
2749.014 Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 729, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 924, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 560, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.6/dist-packages/bzrlib/builtins.py", line 1495, in run
    reconcile(dir)
  File "/usr/lib/python2.6/dist-packages/bzrlib/reconcile.py", line 53, in reconcile
    reconciler.reconcile()
  File "/usr/lib/python2.6/dist-packages/bzrlib/reconcile.py", line 77, in reconcile
    self._reconcile()
  File "/usr/lib/python2.6/dist-packages/bzrlib/reconcile.py", line 84, in _reconcile
    self._reconcile_repository()
  File "/usr/lib/python2.6/dist-packages/bzrlib/reconcile.py", line 103, in _reconcile_repository
    repo_reconciler = self.repo.reconcile(thorough=True)
  File "/usr/lib/python2.6/dist-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/repofmt/pack_repo.py", line 2358, in reconcile
    reconciler.reconcile()
  File "/usr/lib/python2.6/dist-packages/bzrlib/reconcile.py", line 200, in reconcile
    self._reconcile_steps()
  File "/usr/lib/python2.6/dist-packages/bzrlib/reconcile.py", line 514, in _reconcile_steps
    ".reconcile", all_revisions, self.pb)
  File "/usr/lib/python2.6/dist-packages/bzrlib/repofmt/pack_repo.py", line 2363, in _reconcile_pack
    return packer.pack(pb)
  File "/usr/lib/python2.6/dist-packages/bzrlib/repofmt/pack_repo.py", line 753, in pack
    return self._create_pack_from_packs()
  File "/usr/lib/python2.6/dist-packages/bzrlib/repofmt/pack_repo.py", line 916, in _create_pack_from_packs
    self._copy_text_texts()
  File "/usr/lib/python2.6/dist-packages/bzrlib/repofmt/pack_repo.py", line 1295, in _copy_text_texts
    self.new_pack.text_in...

Read more...

Revision history for this message
Ted Gould (ted) wrote :

Okay, this script will cause it on a new repository.

ted@shi:~/bzrbreaker$ ./doit.sh
Created a standalone tree (format: pack-0.92)
adding file1
Committing to: /home/ted/bzrbreaker/bob/
added file1
Committed revision 1.
4096+0 records in
4096+0 records out
2097152 bytes (2.1 MB) copied, 0.0304176 s, 68.9 MB/s
4096+0 records in
4096+0 records out
2097152 bytes (2.1 MB) copied, 0.0346657 s, 60.5 MB/s
adding file2
adding file3
Committing to: /home/ted/bzrbreaker/bob/
Unable to obtain lock file:///home/ted/bzrbreaker/bob/.bzr/branch/lock
held by <email address hidden> on host shi [process #1690]
locked 0 seconds ago
Will continue to try until 09:13:12, unless you press Ctrl-C
If you're sure that it's not being modified, use bzr break-lock file:///home/ted/bzrbreaker/bob/.bzr/branch/lock
added file2
Committed revision 2.
Committing to: /home/ted/bzrbreaker/bob/
added file3
Committed revision 1.
ted@shi:~/bzrbreaker$ cd bob
ted@shi:~/bzrbreaker/bob$ bzr log
------------------------------------------------------------
revno: 1
committer: Ted Gould <email address hidden>
branch nick: bob
timestamp: Mon 2009-06-22 09:08:13 -0500
message:
  File 3
------------------------------------------------------------
revno: 0
committer: Ted Gould <email address hidden>
branch nick: bob
timestamp: Mon 2009-06-22 09:08:12 -0500
message:
  File 2
------------------------------------------------------------
revno: -1
committer: Ted Gould <email address hidden>
branch nick: bob
timestamp: Mon 2009-06-22 09:08:10 -0500
message:
  File 1
ted@shi:~/bzrbreaker/bob$

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

hmm... I'll note that doing "bzr reconcile" should be able to fix this sort of thing.

Martin Pool (mbp)
summary: - Revno reset to 1, others now negative
+ revno cache out of sync with actual branch revnos
Changed in bzr:
status: New → Confirmed
importance: Undecided → Medium
Jelmer Vernooij (jelmer)
tags: added: revno
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
tags: removed: check-for-breezy
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.