> -----Original Message-----
> From: Philip Martin [mailto:philip.mar...@wandisco.com]
> Sent: maandag 23 november 2009 11:09
> To: Hyrum K. Wright
> Cc: dev@subversion.apache.org
> Subject: Re: svn commit: r882232 - in /subversion/trunk/subversion:
> libsvn_client/revert.c tests/cmdline/schedule_tests.py
> 
> Philip Martin <philip.mar...@wandisco.com> writes:
> 
> > The current locking appears to be broken, there are paths that modify
> > the metadata without verifying that a lock is held.  I don't know how
> > widespread this is
> 
> I scattered calls to svn_wc__write_check through libsvn_wc/wc_db.c and
> I get over a hundred regression test failures.  I'm tempted to commit
> it despite the failures.


Note that there are two kinds of operations in wc_db.c that need a different
kind of write check:

* The atomic operations. WC-NG operations that can operate without outside
knowledge learned before the operation.

These functions that are just one sqlite transaction by itself, just need to
make sure nobody else has a write lock. Having a write lock is not required
for operations like just changing the actual properties on a node. Of course
nobody else can own a write lock, or it might change the properties after
sending the commit data, but before moving the data to the base_node table.

Once we have a central DB it will be really easy to perform this nobody else
has a write lock check. (Checking if we ourselves have a write lock ourself
is just a memory lookup of course).

* Partial operations

These operations rely on data read before the wc_db operation and only work
correctly if the data didn't change since reading. All entry based
operations are in this category and the WC-NG work tries to redesign several
of these operation to the first class of operations.

These operations really need a write lock and we need far more checks here.

        Bert

Reply via email to