Bazaar dirstate locking

Robert Collins robertc at robertcollins.net
Mon May 17 04:18:33 BST 2010


On reading from a database that is being mutated -  the ability to do
any sort of read really depends on the database structure.

Trivially, consider a database consisting of a single file, with lines
that can reference other lines above or below to make a tree:
Parent contents
parent contents

e.g.

- /
2 foo
1 bar

would be a tree containing /, /bar and /bar/foo

If writes to this db are done by write() or mmaped data, its very hard
to implement even something as simple as a safe table scan without
file wide OS locks.

Sure, when you have a page orientated db, or a transaction orientated
one, you can implement highly concurrent stuff, but the very minimal
thing that makes up the dirstate file isn't page orientated and isn't
highly concurrent in the presence of a writer.

I really have to emphasis that this is:
 - a bug [designed in years ago]
 - with a alpha quality patch to fix it
 - not in any way considered a feature.



More information about the bazaar mailing list