[bug 277537] [REVIEW] A highly specific reconcile
Vincent Ladeuil
v.ladeuil+lp at free.fr
Thu Oct 16 08:19:17 BST 2008
Hi all,
This needs to be reviewed without BB support (it's a plugin, not
a patch against bzr itself), please keep that in mind if you want
to track it.
Bug https://bugs.launchpad.net/bzr/+bug/277537 is about a
repository in which some file revisions have inconsistent
parents.
This can be addressed by bzr check/bzr reconcile except that in
that case bzr check requires 32 hours to run and bzr reconcile 20
hours (jam provided a patch to cache a bit more aggressively for
both check and reconcile (thanks for that) but in the end, it
made my VM trashed to the point I had to kill it (lucky/unlucky
who knows ?)).
Since check/reconcile has to be done for any repository in the
wild, I thought it may be wise to provide a quicker way.
An important point to understand is that this bug is about data
produced during a conversion and not a bug about how bzr use that
data. Even the if one can argue about the the later, what seemed
more important to me was to fix the data at least because users
encountering that bug may not want to upgrade bzr to get it
fixed.
So I wrote lp:~vila/bzr/fix277537, a simple plugin that can fix
the inconsistent parents by using a description of which file
revisions need to be fixed.
These descriptions are acquired from bzr check which should still
be run once (32 hours, but only once), then, the fix can be
applied to all repositories:
time -p bzr fix277537 ~/.bazaar/plugins/fix277537/buggy-file-revids-081011
Will try to fix 46229 wrong parents
Fixed 46229 wrong parents
0 wrong parents were already fixed
real 312.96
user 249.93
sys 30.98
So 73919 (reconcile) / 312 (fix277537) gives a 23961% improvement
in time :-)
I was a bit concerned about modifying a repository that way until
I realized that I was, indeed, doing the same work as reconcile
itself: updating meta-data, not revisions themselves.
312 seconds seems an acceptable delay for any user of these
repositories during which he can't commit in any of his branches,
it also sounds quick enough to be applied on shared repositories
on servers without getting them off-line.
I checked that the annotations are now correct but I'd like that
code to be reviewed before releasing it.
The most important revisions to be reviewed are:
- http://bazaar.launchpad.net/~vila/bzr/fix277537/revision/6
which get the needed time from 20 hours down to 2h10,
- http://bazaar.launchpad.net/~vila/bzr/fix277537/revision/10
which get it down to 312 seconds.
But an overall review will be welcome too regarding the way the
plugin can be used (some of the broken repositories are hosted in
launchpad and if some LOSA can fix them locally, that will be
greatly appreciated).
Vincent
More information about the bazaar
mailing list