[BUG] stat cache doesn't handle old pathnames with new ids properly

Aaron Bentley aaron.bentley at utoronto.ca
Sun Jul 3 21:43:43 BST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Today, I was testing out baz2bzr on the MoinMoin Arch tree, because its
creator, Thomas Waldman, was interested in bzr.

We both found we got lots of warning messages about duplicate paths in
the cache.

It appears the stat cache doesn't delete entries that don't match files,
and so duplicate entries can be produced.

To reproduce this bug, you: can do
bzr init; touch foo; sleep 2; bzr add foo; bzr commit -m "first"; bzr
remove foo; bzr add foo; bzr commit -m "second"

When you can .bzr/stat-cache, you should see there are two entries for
the same pathname.

Is there any particular reason why the statcache is indexed by id,
rather than pathname?  The latter makes sense to me, and reduces the
number of layers that the statcache must be aware of, and a file's sha-1
sum doesn't depend on its file-id.  (Oh, and it would make this bug
impossible, because new entries would automatically replace old ones).

It should be noted that Arch conversions will tend to have this property
if they used Arch's symlink-storing capability.  Long-standing
implementation bugs mean that replacing a symlink with a file is best
done by first removing the symlink, them committing, then adding the file.

Aaron

P.S. Here's a sample of the warnings I'm getting:

bzr: warning: duplicated path in cache:
u'wiki/underlay/pages/WillekeurigePagina/revisions/00000001'
bzr: warning: duplicated path in cache:
u'wiki/underlay/pages/EventStats/revisions/00000001'
bzr: warning: duplicated path in cache:
u'wiki/underlay/pages/SlideTemplate/revisions/00000001'
bzr: warning: duplicated path in cache:
u'wiki/underlay/pages/EventStats/current'
bzr: warning: duplicated path in cache:
u'wiki/underlay/pages/SystemInfo/current'
bzr: warning: duplicated path in cache:
u'wiki/underlay/pages/(e5b8aee58aa92de7b3bbe7bb9fe8aebee7bdae)/revisions/00000001'
bzr: warning: duplicated path in cache:
u'wiki/underlay/pages/(e5ada4e7ab8be9a081e99da2)/revisions/00000001'
bzr: warning: duplicated path in cache:
u'wiki/underlay/pages/HilfeZuProzessoren/current'
bzr: warning: duplicated path in cache:
u'wiki/underlay/pages/HilfeZuProzessoren/revisions/00000001'
bzr: warning: duplicated path in cache:
u'wiki/underlay/pages/WikiNamn/current'
bzr: warning: duplicated path in cache:
u'wiki/htdocs/classic/css/.cvsignore'
bzr: warning: duplicated path in cache:
u'wiki/underlay/pages/Hj(c3a6)lpListe/current'
bzr: warning: duplicated path in cache:
u'wiki/underlay/pages/(e5b8aee58aa9e6a8a1e69dbf)/current'
bzr: warning: duplicated path in cache:
u'wiki/underlay/pages/(e5b8aee58aa92de694bee698a0e5b9bbe781afe789872f)000_(e5898de8a880)/revisions/00000001'
bzr: warning: duplicated path in cache:
u'wiki/underlay/pages/IndexVanWoorden/revisions/00000001'
bzr: warning: duplicated path in cache:
u'wiki/underlay/pages/WikiNaam/revisions/00000001'
bzr: warning: duplicated path in cache:
u'wiki/underlay/pages/LocalSpellingWords/current'
bzr: warning: duplicated path in cache:
u'wiki/underlay/pages/MoinMoin(2f)TekstOpmaak/revisions/00000001'
bzr: warning: duplicated path in cache:
u'wiki/underlay/pages/HjemmesideSkabelon/revisions/00000001'
bzr: warning: duplicated path in cache:
u'wiki/underlay/pages/AiutoSuIstruzioniDiProcesso/revisions/00000001'
bzr: warning: duplicated path in cache:
u'wiki/underlay/pages/AufgegebeneSeiten/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCyE3/0F+nu1YWqI0RAhliAJwJTOO1Nq3zSM6n5faY2rL2jKvQdwCcDrFP
RhhviFKhgHdRaExDAPnvqMk=
=qmsY
-----END PGP SIGNATURE-----




More information about the bazaar mailing list